\title{% As a rule, there should be a either a '%'
       % or text right after every open curly bracket
       %
       % Take note that TeX  commands that expand to real
       % text (as opposed to those that change the appearance of
       % of the tex) should be followed by {}. See the
       % usage of the \LaTeXe command in the following:
    \LaTeXe{}
for Technion Graduate Students\thanks{%
%Take note that \footnote should not be used in the
%\title or the \author definitions. Use \thanks instead.
%Also, notice that there is no space between Students and \thanks
    This is a live document. Check often in
        \texttt{http://www.cs.technion.ac.il/~yogi/\jobname.tex} to find the latest version%
}
}

\author{%
%This is probably the only place in your document which you should
%directly mess around with fonts and their size.
        \Large
        \textsc{Joseph (Yossi) Gil}%
%\textsc{Some Text} produces this text in small caps mode.
         \thanks{Work done in part during a visit to the IBM T.J.
                Watson Research Center}
%If the authors are from different institutes, it is better
%to separate them using the \and macro, which only
%works in the title command. Otherwise, just use \quad
%which is a ``certain'' amount of space, or \qquad
%which produces a slightly larger space
            \qquad % Big horizontal distance
            \qquad
        \textsc{My Other Self}%
                \thanks{Contact author}
        \\
        \mbox{}\\ %  \\ forces a new line. However, LaTeX complains
% if you break an empty line. \mbox{} puts an empty
% box in the line, which makes it possible to break a line here.
        Department of Computer Science\\
        Technion---Israel Institute of Technology\\
        Technion City, Haifa 32000, \underline{Israel}\\
        \mbox{}\\ %
        \normalsize
            \texttt{YoGi}
        \textbar{}
            \texttt{yogi}
            \texttt{@cs.technion.ac.il}
}
% The \date is an optional title element command. If you do define
% it, then LaTeX2e will add the date for you. If you do not want
% the date to be shown, i.e., in a submission to a conference
% just make an empty \date command, as in \date{}.
% The following is just asking LaTeX2e to do what it would have
% done if you do not ask...
\date{% Any text can go in here, not necessarily a date.
    \today
}

% The document class is article, book, report, etc. The most common
% one is article. Many conferences and journal provide their own
% document class. The two most common ones are llncs (Lecture Notes in
% computer science, by Springer Verlag), and acmconf (for ACM conferences).

% There are three problems with LaTeX defaults, which should be
% corrected around here: font size, paper size, and margins.
% A 12pt font is much more readable than the default 10pt. The
% 12pt option to the \documentclass command takes care of this.
\documentclass[12pt]{article}


% LaTeX was designed by an American for Americans. Therefore,
% the default paper size is letter, 8.5"x11". It is possible to
% pass an a4paper option to the document class to the \documentclass
% command, as in
%            \documentclass[a4paper,12pt]{article}
% but there is a much better way of doing that, as we will see next.
% The a4paper option sets the \paperwidth and the \paperheight macros,
% which one can use later. One could also use other paper size options,
% including  letterpaper (which is the one to use if you are sending
% your paper to the USA).
% The third problem is that LaTeX margins are usually too wide.
% This cannot be corrected directly in the document class line.
% Your document will look much better if you use narrower margins.
% Most people tend to tweak their margins by hand. I now recommend
% to use the geometry package for doing this. The geometry package
% also understands paper size options. Take notice of how arguments
% are passed to packages.
% You may need to search around to find this package, but is well
% worth it. Download it from the net, ask a friend, or your friendly
% system administrator.
\usepackage[paper=a4paper,dvips,top=1.5cm,left=1.5cm,right=1.5cm,
    foot=1cm,bottom=1.5cm]{geometry}


% It is my opinion that the Times fonts is easier
% on the eyes. Also, it is supposed to be print
% faster on a  PostScript printer. Further more,
% it occupies less space than the computer modern font, without
% appearing to be too cluttered.
\usepackage{times}

% The graphicx package is what you will need for
% incorporating encapsulated PostScript files.
\usepackage{graphicx}

% Use the American Mathematical Society packages
% to solve many common problems, and to get
% a rich repertoire of mathematical symbols.

% The amsmath package allows for printing
% better equations. The fleqn option left flushes
% all equations instead of centering them. If you
% you do not use this option, your equations will be
% centered, which is OK if you only have a small number
% of equations. If you use many equations, it is nice
% to see these all aligned.



\usepackage[fleqn]{amsmath}

% Various AMS fonts.
\usepackage{amsfonts}

% Many special mathematical characters, including the
% famous blackboard bold letters used.
\usepackage{amssymb}

% Theorems using the AMS style.
\usepackage{amsthm}


% A package for declaring new mathematical operators
\usepackage{amsopn}
% Here are a few examples on how this can be used.
\DeclareMathOperator{\parents}{parents}
\DeclareMathOperator{\roots}{roots}
\DeclareMathOperator{\level}{level}
\DeclareMathOperator{\descendants}{descendants}
\DeclareMathOperator{\id}{id}
\DeclareMathOperator{\frontier}{frontier}
\DeclareMathOperator{\LCOM}{LCOM}


% The xspace package defines an \xspace macro, which
% comes in real handy when you define macros that expand
% to words.
\usepackage{xspace}

% Managing figures and other floating bodies is a daunting task.
% When there are even a few of them, LaTeX likes to throw these
% in separate pages, at the end. Here is how you can convince it
% throw more figures in the text.

% The following command allows any number of figures at the top of the
% page. If you set the topnumber to 5, then the maximal number of figures
% at the top of the page is going to be 5.
\setcounter{topnumber}{0}

% Same, but for figures at the bottom of the page.
\setcounter{bottomnumber}{0}

% Maximal number of figures in a page.
\setcounter{totalnumber}{20}

% The minimal amount of text in a page is 1% after the following
% command.
\renewcommand{\textfraction}{0.01}


% prohibits pages consisting solely of floats.
\renewcommand{\floatpagefraction}{0.0}




% Here is a definition of few useful macros for
% writing programming languages names.


% The following defines a macro for typing the name of the programming
% language such C++ in such a way that it would not ever hyphenate.
% Note how \xspace is used. Also, take note that since TeX has no
% no static typing, it is possible to define using another a macro
% which was not yet defined. In fact, TeX uses dynamic binding.
% In invoking \CC{}, the current version of the \Lang macro
% will be invoked.
\newcommand\CC{\Lang{\mbox{C++}}\xspace}

% The following macro is a definition of a standard style
% for printing the names of programming languages. Note how
% macros with arguments are defined. There is no need for \xspace
% in macros which take parameters, since the macro is terminated with
% the closing curly brackets of the last argument.
\newcommand\Lang[1]{\textsc{#1}}

% And here we define a useful macro for typing out
% bold teletype text as should be done for printing
% out keywords in programs.
\newcommand{\keyword}[1]{\texttt{\textbf{#1}}}




\newcommand{\newVar}[2]{\newcommand{#1}{\ensuremath{#2}\xspace}}
% Here are some definitions of common mathematical notations.
% In general it is a good idea to make a dictionary of notations
% in the preamble.

\newVar\Naturals{\mathbb{N}}
\newVar\Integers{\mathbb{Z}}
\newVar\Rationals{\mathbb{Q}}
\newVar\Reals{\mathbb{R}}
\newVar\Complex{\mathbb{C}}

% Here are some definitions of mathematical macros with
% an argument.
\newcommand\norm[1]{\ensuremath{\lVert#1\rVert}}
\newcommand\abs[1]{\ensuremath{\lvert#1\rvert}}
\newcommand\ceil[1]{\ensuremath{\lceil#1\rceil}}
\newcommand\floor[1]{\ensuremath{\lfloor#1\rfloor}}
\newcommand\set[1]{\ensuremath{\{#1\}}}
\newcommand\angular[1]{\ensuremath{\langle#1\rangle}}
\newcommand\paren[1]{\ensuremath{(#1)}}

\newcommand\Norm[1]{\ensuremath{\left\lVert#1\right\rVert}}
\newcommand\Abs[1]{\ensuremath{\left\lvert#1\right\rvert}}
\newcommand\Ceil[1]{\ensuremath{\left\lceil#1\right\rceil}}
\newcommand\Floor[1]{\ensuremath{\left\lfloor#1\right\rfloor}}
\newcommand\Set[1]{\ensuremath{\left\{#1\right\}}}
\newcommand\Angular[1]{\ensuremath{\left\langle#1\right\rangle}}
\newcommand\Paren[1]{\ensuremath{\left(#1\right)}}


\newcommand\st{\;|\;}



\newVar\pqTree{{\cal P}}
\newVar\groups{\mathbf{G}}
\newVar\lastGroup{\ell}
\newVar{\currentId}{\ensuremath{\id}\xspace}


% The following is probably the optimal method for numbering
% lemmas, examples, definitions their like. We number them
% all together. It is annoying and difficult
% for the reader to search for these theorem-like entities in
% if they are.

% Numbering of theorems is by section, e.g., Theorem 1.3, etc.
% This makes it easier for the reader to search for them.

\newtheorem{theorem}{Theorem}[section]
\newtheorem{definition}[theorem]{Definition}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{fact}[theorem]{Fact}
\newtheorem{example}[theorem]{Example}

% If the paper has a large number of equations, figures, tables, etc.,
% then they should be numbered within sections. Comment out
% if this is not what you want.
\numberwithin{equation}{section}
\numberwithin{figure}{section}
\numberwithin{table}{section}

% The algorithmic package is incredibly powerful in printing algorithms.
% The noend option eliminates the end-if, end-for etc. to save valuable
% space.
\usepackage[noend]{algorithmic}

% The algorithm package defines the algorithm floating body, which
% can be used like figures and tables. The plain option makes algorithm
% have the same layout as figures. The default option puts the caption
% on the top, bounded between two rules.
\usepackage[plain]{algorithm}

% Next we customize the algorithm environment
% to print comments in a C++ like style and using
% an italic font.
\renewcommand\algorithmiccomment[1]{// \textit{#1}}
% Another customization is the capitalization of
% of commands
\renewcommand\algorithmicif{\textbf{If}}
\renewcommand\algorithmicfor{\textbf{For}}
\renewcommand\algorithmicforall{\textbf{For all}}
\renewcommand\algorithmicwhile{\textbf{While}}

\usepackage{labels} %
\newRef{Table}{Table~\ref{Table:#1}}

% The equation package is handy in labeling and referencing
% numbered equations. To insert a labeled numbered equation
% write \beq{label} ... \eeq. To refer to it write \EQ(label).
% Do take note that the \EQ macro expected its parameter in
% round parenthesis, not curly brackets.
% Variants to the \beq command are:
% \beqs - for a split equation (use & for a single alignment
%         point and \\ for line breaking
% \beqst - Same without numbering the equation nor labeling it.
% \beqa  - For aligned equations (no labels). Each aligned equation
%          can have its own label.
\usepackage{equation}
\usepackage{showkeys}


\usepackage{prog2tex}
% This is where your document starts. Everything up to here
% was just definitions.
\begin{document}

% The first thing we do is to create the title, as defined by the
% \author, \title and \date command above. If there were errors
% in the
\maketitle

\begin{abstract}
Every paper starts with an abstract which should be short and written
    in a very special style.
The abstract is used mostly by people who do not wish to read the
    paper, and are looking for short description of what's in it.
The abstract is written last.
In the first papers your write, it is usually better to let
    your advisor write it for you.
\end{abstract}

\section{Introduction}
In general, every paper has an introduction.
The introduction puts the problem at hand in context.
Why is it interesting, what were the previous attacks on it,
    and how a solution to it might be used.

I noticed that I spend (some would say waste) so much of my time in
    teaching the same basic writing skills to almost every graduate student
    who sought the dubious pleasures of my advisorship.
Topic such as using \LaTeX2e, basic typography, tabulating data,
    drawing clear figures, making precise mathematical definitions,
    and general scientific writing style, etc. are recurring so frequently,
    that I decided I must do something about it.
Finding myself rewriting almost everything that a student writes, is frustrating
    both for me and for the student.
Call me perfectionist, but that's how I am \ldots

Some people I work with may even end up with a bitter taste seeing
    everything they did torn apart, thinking that the fault lies with them.
It is so difficult to accept the ancient proverb on the weight of words,
    and its consequences---that the amount of labor it takes
    to produce any written word is so much greater than typing it.
Perhaps the best metaphor here is typing with the nose \ldots

In the interest of reducing my tutoring effort, I offered
    a seminar to a selected bunch of graduate students, mostly by invitation.
This low quality document is the product of the first run of this
    seminar.
It was not surprising to me to find out that most of the difficulties
    students incur have nothing to do with English, but rather with
    turning our rambling thoughts into a precise, focused and terse written document.

\newcommand\BibTeX{\textsc{Bib}\TeX\xspace}



The topics discussed included:
\begin{enumerate}
\item \TeX, \LaTeX{}, and \LaTeX2e{}.
    Tools of the trade, and tricks of the gurus.
\item Elementary typography, fonts and simple checklists
\item \BibTeX{}, bibliography and references to bibliography.
\item The Elements of style by White and Strunk, the Elements of Grammar
\item The structure of sentences, paragraphs, and sections.
\item Paragraph structure
\item Paper outline: Title, abstract, keywords, introduction,
    conclusions, discussion, and future research, acknowledgements
\item Informative tables and figures
\item Formulae, definitions and theorems
\item Reviewing papers
\end{enumerate}




Each participant will be asked to attend at least 75\% of all meetings,
prepare
a summary of at least one topic.
Weekly assignments included:
\begin{itemize}
\item Make a complete bibliographic entry of these five articles.
\item Rewrite this sentence in 10 different ways.
\item Translate this document into \LaTeXe.
\item Point out all typographic errors in this paragraph.
\item Tear apart this paragraph.
\item Rewrite this paragraph.
\item Identify the points made in each paragraph of a given section
\item Criticize the writing of another course participant
\end{itemize}


Lectures were interactive, and I will frequently make use
of a monitor to demonstrate the process of thinking and editing
a scientific document.
\

\paragraph{Outline}
The last paragraph in the introduction should
    serve as a mini table of contents.
In \Ref{Section}{so-and-so}\footnote{%
            Note that in giving reference to a section, correct technical
        writing dictates that we must capitalize the word ``Section''},
    we do so and so.
Section blah does that, while
    Section tralaha does this.
Finally, section what-ever-its-number is gives the conclusions.


\section{Basics}
\label{so-and-so}


\subsection{How to run \LaTeXe}

\begin{description}
    \item[Running \LaTeXe{}] To compile an input \LaTeXe{} file
        \begin{quote}    \tt
        latex2e \jobname.tex
        \end{quote}
If this does not work, make sure that
\begin{verbatim}
/usr/local/lib/texmf/bin/sparc-solaris2.4
\end{verbatim}
is in your path. Try to put it as early in the path list as possible.
This should be done by including the following
line in your \texttt{.login} file.
\begin{verbatim}
    set path = (/usr/local/lib/texmf/bin/sparc-solaris2.4 $path)
\end{verbatim}

    \item[Dealing with \LaTeXe{} Errors]
        Do not loose heart.
        \LaTeXe{} is easy and most bugs can be tracked down very
            quickly.
        At first it is easier and faster to ask someone for
            help.
        Shortly thereafter, you will find that you can
            deal with errors yourself.

    \item[Multiple Runs]
            If \LaTeXe{} produces warnings that some labels are
                undefined, you must run it again for the following
                reason.
        In the first run, \LaTeXe{} produces a file named
        \texttt{\jobname.aux} which includes definitions of the
            labels (as produced by the \verb+\label+ command).
        In the second run, \LaTeXe{} reads this file before processing
            the main input.
        This makes it possible to give forward references to labels.
        In the second run, the \texttt{.aux} file is reproduced, and
            this reproduction should be identical to the first.
        If they are different, \LaTeXe{} complains that ``labels may
            have changed''.
        You should rerun it to make it happy.
        The chances that you would require a fourth run
            are infintisimal.

        It is interesting to examine the \LaTeXe{} definitions in
            the \texttt{.aux} file:
        \begin{quote}\tt
            more \jobname.aux
        \end{quote}
        In extreme situations, a buggy \texttt{.aux} file is
            produced, and \LaTeXe{} is not able to run at all
            as a result.
        In this case, you should remove the file \texttt{.aux} file.
        \begin{quote}\tt
            rm \jobname.aux
        \end{quote}
        and start over again.


    \item[Viewing] The product of a \LaTeXe{} run is a \texttt{.dvi}
                (device independent) file.
        To view a \texttt{.dvi} file
        \begin{quote}\tt
            xdvi \jobname.dvi
        \end{quote}
        The default extension is \texttt{.dvi}, so for short,
            you could write:
        \begin{quote}\tt
            xdvi \jobname
        \end{quote}
        Usually, \texttt{xdvi} is not set up properly, to deal
        with A4 paper.
        Therefore, the correct command to run is:
        \begin{quote}\tt
            xdvi -paper a4 \jobname
        \end{quote}
        Alternatively, you can set up an alias or fix your
        \texttt{.Xdefaults} file, but I am not going to tell you
        how you should do any of these simple UNIX tasks \ldots.

    One problem you might have in viewing the file is that you did
        not set the \texttt{DISPLAY} environment variable correctly.
    This should be done by a command of the sort
    \begin{quote}
        \tt %Note that commands made within an environment
            %are limited in their scope to that environment.\
        setenv DISPLAY \emph{machine-name}:0
    \end{quote}
    For example, if the name of your workstation is
            \texttt{sg237s8} you should write:
    \begin{quote}
        \tt
        setenv DISPLAY sg237s8:0
    \end{quote}

    \item[Converting to PostScript]
            To create \texttt{\jobname.ps} from \texttt{\jobname.dvi}.
        \begin{quote}\tt
            dvips \jobname.dvi
        \end{quote}
            Again, the default is to search for a \texttt{.dvi} file,
                so the \texttt{.dvi} extension needs not be typed.

    \item[Viewing a PostScript file]
            To view texttt{\jobname.ps} on your display, use
        \begin{quote}\tt
            ghostview \jobname.ps
        \end{quote}
            Again, the default is to search for a \texttt{.dvi} file,
                so the \texttt{.dvi} extension needs not be typed.

    \item[Printing]
            To print a \texttt{.dvi} file on a PostScript printer,
                use the \texttt{-P} flag:
        \begin{quote}\tt
            dvips -Pb617d2 \jobname.dvi
        \end{quote}
This will send the material
    to the \verb"b617d2" printer, which is a black and white printer,
    located at room 617 in the 6\textsuperscript{\textit{th}} floor,
    and is a duplex printer.
Another way of doing this is:
        \begin{quote}\tt
            dvips -Pb617d2 \jobname
        \end{quote}
            for short.
        If you already generated a PostScript file then you can send
            it to the printer.
        \begin{quote}\tt
            lpr -Pb617d2 \jobname.ps
        \end{quote}
        Note that this time the extension has to be typed in.
\texttt{lpr} does not have a default extension.



    \item[Bibliography] To run \BibTeX:
        \begin{quote}\tt
            bibtex \jobname
        \end{quote}
        Note that \BibTeX requires multiple runs, sometimes as
            many as three.

\end{description}


\subsection{Check list}

Before showing your output to any other person, and
        especially before presenting it to an impatient
        advisor, make sure that your document is as perfect as it can
        be.
Use the following check list:

\begin{enumerate}
    \item
        Use \LaTeXe, rather than \LaTeX.

    \item
        Spell check your document using \texttt{ispell}.
        Make sure that \texttt{ispell} produces a ``clean'' run!
        If it doesn't, repeatedly add the extra words to your personal
            dictionary.

    \item
        Use \texttt{lacheck}  UNIX utility to discover some
            \LaTeXe{} input errors.
        Make sure that \texttt{lacheck} produces a ``clean'' run!

    \item

        Can you find the typos in the following text?


    \begin{small}\begin{quotation}
        In view of this painful possibility, I will not (as I might)
        appeal indignantly to my other writings as as a proof that I am
        incapable of such a deed: I will not (as I might) point to the
        strong moral purpose of this poem itself, to the arithmetical
        principles so cautiously inculcated in it, or to its
        its noble teachings in Natural History--I will take the more prosaic course
        of simply explaining how it it happened.
        \footnote{Quoted from ``The Hunting of the Snark" by Lewis
        Carroll}
    \end{quotation}\end{small}

    Hard to find? Check again! The words ``as'' and ``its'' are duplicated, a mistake
        usually happening with a line break between the two occurrences.
    Use my \texttt{dup} to eliminate duplicate words in
            sequence.
        The complete path to the \texttt{dup} utility is:
            \begin{quote}\tt
                /home/yogi/Bin/dup \jobname.tex
            \end{quote}

               As an extra bonus, \texttt{dup} also checks that all
            words which follow a period are capitalized, and
    it tries to apply a number of other little checks to your
document.

\item    Capitalization is also an important issue. Every sentence
    should start with an uppercase letter.
    The important words in titles are usually capitalized.
    This includes the first and last words and all
    other words except articles and prepositions. Proper nouns
    such us names of people or places should also be capitalized.
    Initials should be entirely in uppercase, e.g., FBI.


\item
The acronyms ``\emph{i.e.}" and ``\emph{e.g.}" must be followed by a
comma.
Not including a comma is not only a grammatical error. It will also
    make \TeX{} think that the last period in
        ``\emph{e.g.}" is a sentence end, adding funny extra space after it.l
\texttt{dup} does try to this sort of errors.
\item One problem that \texttt{dup} cannot always detect is the correct use
    of articles.
   The indefinite article \emph{a} should be used when followed by an initial
    consonant sound, including a pronounced \emph{h}.
    For example: a computer, a division, a house.

    When the word starts with a vowel or a very weakly pronounced \emph{h}
    (especially in British English), the article should be
    \emph{an}. For example: an arch, an honor, an historian.
    The \emph{an} article should be also used before a
    single letter (or initials) whose name starts with a vowel.
    For example, one should write \emph{An} MS-DOS typical fault, \emph{an} 8-bit field, etc.

    \item
        Make sure that the input file uses indentation in such
            a way that reveals its logical structure.
        Use my \texttt{format} to apply smart indentation in the
            format suggested below.
            \begin{quote}\tt
                /home/yogi/Bin/format \verb+<+ \jobname.tex \verb+>+ \jobname.new.tex
            \end{quote}
        Manually check \texttt{\jobname.new.tex} because \texttt{format} is
            quite dumb.
\end{enumerate}


\section{Plain Text}

In general, you should not worry yourself details of format of such
    things as space between paragraphs, line spacing,  indentation and
    the such.
It is a common mistake of novices to use low level commands such as~\verb+\\+,
    (forcing a line break), \verb+\hspace+ (forcing a horizontal space),
    \verb+\vspace+ (forcing a vertical space), etc.\ in their input to give it
    some desirable special appearance.
You should resist the temptation to do so!
Instead, you must search for the appropriate high-level, logical
    commands, which express the structure of your text, rather
    than any desirable visual appearance.
For example, you should break
    a line explicitly, which is a physical operation.
The correct \emph{logical operation} is the
    start of a new paragraph, which is simply denoted by an
    empty line in the input.

The default output is set by the document class, and
            in almost all cases is what you want.
In fairness, it should be said the defaults are what you should have
            wanted, if you spent enough time in learning all the bits
            and ends of typography.
For example, in most document classes, paragraphs are indented
    in, with the exception of a first paragraph in a section
    or a subsection.
Also, the vertical spacing between paragraphs is usually slightly
    larger in between lines.

Use indentation in your input file wisely, so that the logical
        structure would be apparent from the text layout.
My suggestion is to start every sentence in a new line.
If the sentence spans more than 72 characters, start the next
        line with an indentation.
This gives you a visual clue on the number of sentences in each
        paragraph, which is usually 4--6.


Most of your \LaTeX{} input should be plain text, with scattered
    mathematical formulae.
Just type your text in, paying little or no attention to details
    such as line breaks, spacing between words, etc.


In typing your text, take note that there are some characters
    do have special meaning.
The alphanumerical characters: A\ldots,Z, a,\ldots, z, 0, \ldots, 9 and
    most punctuation marks including the comma (,), the
    period~(,), the semicolon~(;), the exclamation mark (!),
    the question mark (?), etc.\ be typed directly
    into \LaTeXe.
\Ref{Table}{format:characters} enumerates what we call
    \emph{formatting} characters, used for placing
    ligatures and other symbols insider your text.
(There are also some \emph{special} characters which
    do not directly produce output; these will be the subject of the next section.)

\begin{table}[!ht]
\begin{center}
\begin{tabular}{|l|l|l|l|}
\hline
    Name & Appearance & Semantics & Escape \\
\hline
Period                & \verb+.+ & Sentence end & \verb+.\ + \\
Greater than     & \verb+>+ & Spanish question mark (<)  & \verb+$>$+\\
Less than  & \verb+<+ & Spanish exclamation mark (>)& \verb+$<$+\\
Open single quote   & \verb+`+ & Quoting & \verb+\}+\\
Close single quote & \verb+'+ & Quoting & \verb+\$+\\
Closing double quote & \verb+"+ & Quoting      & \verb+\_+ \\
Hyphen               & \verb+-+ & Hyphenation & \verb+{-}+ \\
En dash        & \verb+--+ & Range & \verb+{-}{-}+ \\
Em dash        & \verb+---+, \verb+|+& Punctuation mark &  \verb+-{-}-+, \verb+\textbar+\\
\hline
\end{tabular}
\end{center}
\caption{Formatting characters}
\label{Table:format:characters}
\end{table}

\subsection{Punctuation}
The period (.) character, when followed by a space, denotes the end of the sentence.
\TeX{} places a little extra space between sentences\footnote{unless \texttt{\textbackslash{}frenchspacing}
    is used.}.
There are however cases in which a period followed by a space is used to denote an abbreviation,
    as in abbreviations of Latin words, including ``vs.\'' \textit{versus},
        ``etc.'' (etcetera), ``et al.'' (et alii).
The space following the period has to be escaped in these cases.
For example, a figure caption ``Runtime vs.\ input size" should be typed
    \begin{verbatim}
        Runtime vs.\ input size
    \end{verbatim}
Similarly, do not write
        the abbreviation ``etc.'' simply as \verb+etc. +,
        but rather as \verb+etc.\ +, unless it comes at the end of the sentence.


The ``less than'' (\verb+<+) and ``greater than'' symbol do not appear in normal text.
A weird exception worth noting is that electronic mail programs tend to
    add a \verb+>+ symbol in front of the word ``From'' if it is the first
    word in a line.


Take note that displayed mathematical equations are part of the
sentence and should usually be
            followed by a punctuation mark.
    Here is a simple example:
\begin{quote}
    Using Euler's equation,
    \[
        e^{i \pi} + 1 = 0,
    \]
    and the basic trigonometric equality, we obtain that
    \[
        \pi = - i \ln (-\sin^2 x -\cos^2 x).
    \]
\end{quote}


Never write three dots \verb+...+.
Instead, use the
    \verb/\ldots/ macro. In mathematics, remember that
    a comma should precede and follow \ldots, as in
\[
    \mathbf{x} = \langle
    x_1, \ldots, x_n \rangle.
\]
Similarly, an operator should precede and follow \verb+\cdots+:
\[
    1 + \frac{1}{2} + \cdots + \frac{1}{n} = H_n \approx \ln n +
\gamma.
\]



\subsection{Quoting}
\LaTeXe{} distinguished between opening and closing quotes. Do not
        "quote" like this.
    Here is an example of correct ``quoting''.
Thus, opening quotes should be typed in \LaTeX{} as \verb+``+,
    and closing ones as \verb+''+.
Quotes should be used for quotations not as a substitute
    for an appropriate term, or loose presentation.
\texttt{Teletype} font is the best way of marking verbatim text.

\subsection{Dashes}

The great variety in dashes and hyphens take is a major source
    of confusion even for experienced authors.
One common mistake is to place a space before or after
    a hyphen or a dash.
The different variations are:
\begin{itemize}
\item \emph{Inter-word dash, entered as a single \textup{\texttt{-}} character.}
This dash is used to connect two words together, in phrases such
    as multiple-inheritance, and object-oriented entered as \verb+multiple-inheritance+
    and \verb+object-oriented+.
Note that there is \emph{no space} before or after an inter-word dash.
Also note that many such phrases have evolved to be a single word, including
    familiar terms such as ``database'', ``subtyping'', and even ``email''%
        \footnote{The reader may want to check the strong position that D. E. Knuth
            takes in his web page against ``e-mail''.}
Do not let yourself be distracted by spell checkers which are not aware
    of this language evolution.
Do load a specialized dictionary of jargon and terminology.

It is common and effective practice to factor out the second part of
    a conjugated phrase, as in ``single- and multiple-inheritance'',
    entered as
\begin{quote}
\begin{verbatim}
single- and multiple-inheritance
\end{verbatim}
\end{quote}

\item \emph{Range specifier, or an \emph{n-dash}.}
The n-dash is used in phrases chapters I--III, pages 11--87.
\begin{quote}
\begin{verbatim}
The n-dash is used in phrases chapters I--III, pages 11--87.
\end{verbatim}
\end{quote}
Again, no space should be put before or after the dash.

\item \emph{The \emph{m-dash} punctuation mark.}
The m-dash, entered as three  is used to separate parts of a sentence---in cases
    where a weaker than a semicolon but stronger than a comma separator is desired.
It is entered as three consecutive minus characters, or
    as a vertical bar (\texttt{\textbar}),
    with no spaces
    around it.
Also, the official name of our institution is written
\begin{quote}
The Technion|Israel Institute of Technology
\end{quote}
and typed in as
\begin{quote}
\begin{verbatim}
    The Technion---Israel Institute of Technology
\end{verbatim}
\end{quote}
or
\begin{quote}
\begin{verbatim}
    The Technion|Israel Institute of Technology
\end{verbatim}
\end{quote}



\end{itemize}

Two other related variations are:
\begin{itemize}
\item\emph{Minus sign in mathematical formulae.}
A unary or a binary minus in mathematical formulae is entered
    simple as a minus sign.
Spaces do not matter in mathematical formulae.

\item\emph{Discretionary hyphen, entered as \texttt{\textbackslash-}}
\TeX{} does a pretty good job in breaking lines at word boundary
    and in hyphenating words when this not possible.
In the extremely rare cases in which the correct hyphenation is
    different than what \TeX{} algorithm thinks, you may insert \verb+\-+
    anywhere in a word to designate an optional hyphenation point.

The only case in which I found this to be necessary is in writing
    long URL addresses, as in
    \texttt{http://\-www.cs.technion.ac.il/\-\textasciitilde{}yogi/\-\jobname.tex},
    which is the web address of this document.
However, now I prefer to write this address as
    footnote\footnote{\texttt{http://www.cs.technion.ac.il/\textasciitilde{}yogi/\-\jobname.tex}}.
\end{itemize}

In summary, use dashes correctly.
A double dash in the input is used to denote a range.
A triple dash is used as punctuation---breaking a
        sentence into fragments.
Note that there is no space before and after a triple dash.
    A single dash is used as a hyphen.

\section{Special Characters}

Several characters of the  ASCII alphabet have a special meaning for
    \LaTeXe.
\Ref{Table}{command:characters} enumerates all
    these characters.


\begin{table}[!ht]
\begin{center}
\begin{tabular}{|l|l|l|l|}
\hline
    Name & Appearance & Semantics & Escape \\
\hline
Percent              & \verb+%+ & Comment & \verb+\%+ \\
Backslash            & \verb+\+ & Command prefix & \verb+\textbackslash+\\
Open curly bracket   & \verb+{+ & Grouping & \verb+\{+\\
Close curly bracket  & \verb+}+ & Grouping & \verb+\}+\\
Hash sign          & \verb+#+ & Argument & \verb+\#+ \\
Tilde                & \verb+~+ & Non-breakable space &  \verb+\textasciitilde+\\
Dollar symbol        & \verb+$+ & Inline formula & \verb+\$+\\
Underscore           & \verb+_+ & Subscript      & \verb+\_+ \\
Caret                & \verb+^+ & Superscript & \verb-\verb+^+- \\

Ampersand            & \verb+&+ & Alignment & \verb+\&+ \\
\hline
\end{tabular}
\end{center}
\caption{Special characters}
\label{Table:command:characters}
\end{table}

\subsection{Comments}
As can be seen from the table, the percent symbol (\%) is used
    for commenting.
All text that follows a \% until the end of line is not
    processed by \TeX.
It is easy to forget that the commenting carries a little
    further beyond the end of the line, and includes all white
    space characters which follow it:
\begin{quote}
\small
\begin{verbatim}
Spacing away space%notice the use of spaces
    ships will become a major problem of the space age.
\end{verbatim}
Spacing away space%notice the use of spaces
    ships will become a major problem in the space age.
\end{quote}

\subsection{Commands and Environments}
Perhaps the most common special character is the backslash,
    which is used as the prefix of all \LaTeX{} \emph{commands}.
A command begins with a backslash, which can be followed
    by either a single, non alphabetical character
    (as in the \verb+\$+ command), or any number of
    alphabetical characters.
The use of backslash in ordinary text is rare.
If you really need one, use \verb+\textbackslash+.
Take special note that \verb+\\+ does not produce
    a ``\textbackslash'', but rather breaks the current line.
As mentioned above, it is a bad habit to use \verb+\\+.


Curly brackets are primarily used for denoting
    \emph{parameters} to commands.
Thus for example, you may want to \emph{emphasize} a piece
    of text by typing:

\parbox[t]{0.5\textwidth}{\footnotesize\tt
Against stupidity, the \textbackslash emph\{very gods themselves\}
    contend in vain!
}
\parbox[t]{0.5\textwidth}{\footnotesize
Against stupidity, the \emph{very gods themselves}
    contend in vain!
}

Optional parameters are denoted by square brackets.
The following command specifies that the default
    font size of the document is 12pt
\begin{quote}
\small
\begin{verbatim}
\documentclass[12pt]{article}
\end{verbatim}
\end{quote}

Another use of curly brackets is for delimiting the scope
    of commands and definitions.
\begin{quote}
\small
\begin{verbatim}
She grew {\small smaller and smaller} as she ate \ldots
\end{verbatim}
She grew {\tiny smaller and smaller} as she ate \ldots
\end{quote}
Curly brackets do not
    delimit scope when used for embracing parameters.
If this is what you need, use another, nested, pair of curly brackets.


Parameters to most commands cannot span
     multiple paragraphs.
\emph{Environments} are used for applying commands
    to large text bodies.
An environment is written as a \verb+\begin{+$x$\verb+}+
    \verb+\end{+$x$\verb+}+ pair, where~$x$ is
    the environment's name.

\subsubsection{The \texttt{document} Environment}
A \LaTeXe document consists a \emph{preamble}
    and a \emph{body}.
The preamble consists of global definitions.
Some commands such as \verb+\usepackage+ can
    only be placed in the preamble.
It is an error to include text intended for output
    in the preamble.

All document text is written inside
    the \verb+document+ environment:
\begin{quote}
\small
\begin{verbatim}
% This is the preamble
\documentclass[12pt]{article}
\title{The Principle of Reciprocation}
\author{Mother Nature}
\usepackage{times}
\begin{document}
\maketitle
No good deed goes unpunished!
\end{document}
Anything written after \end{document} is ignored.
\end{verbatim}
\end{quote}

\subsubsection{The \texttt{abstract} Environment}
The \texttt{article} document class has an \texttt{abstract}
    environment:

\parbox{0.5\textwidth}{\tt\footnotesize
\obeyspaces\obeylines\frenchspacing
\textbackslash{}begin\{abstract\}\\
The abstract gives a short account
of the context and the main contributions of the paper.
It should be informative enough so that experts can
    quickly \mbox{determine} the relevance of the results to their
    \mbox{research}.
\\{}\\
Even though most abstracts span one \mbox{paragraph}, abstracts
    of two and even more paragraphs do exist.
Some publishers limit the abstract to 150 or so words.
\textbackslash{}end\{abstract\}
} \parbox{0.5\textwidth}{
\begin{abstract}
The abstract gives a short account
    of the context and the main contributions of the paper.
It should be informative enough so that experts can
    quickly determine the relevance of the paper to their
    research.

Even though most abstracts span one paragraph, abstracts
    of two and even more paragraphs do exist.
Some publishers limit the abstract to 150 or so words.
\end{abstract}
}



\subsubsection{Environments as Scope Delimiters}
All environments delimit the scope of any commands
    and definitions made in them.

\parbox{0.5\textwidth}{\tt\footnotesize
\obeyspaces\obeylines\frenchspacing
\textbackslash{}begin\{quote\}\\
\textbackslash{}it Love is all you need!\\
\textbackslash{}end\{quote\}\\
But love does not pay the rent.
}
\parbox{0.5\textwidth}{\footnotesize
\begin{quote}
\it Love is all you need!\\
\end{quote}
But love does not pay the rent.
}

In the rare cases that this effect is not desired, one
    can invoke an environment using a command-like syntax:

\parbox{0.5\textwidth}{\tt\footnotesize
\obeyspaces\obeylines\frenchspacing
\textbackslash{}quote\\
\textbackslash{}it Love is all you need!\\
\textbackslash{}endquote\\
But love does not pay the rent.
}
\parbox{0.5\textwidth}{
\quote\footnotesize
\it Love is all you need!
\endquote
But love does not pay the rent.
}




\subsubsection{Making your own commands}


New users are usually advised against defining
    their own commands, since in most cases,
    there are ready made packages to implement
    specialized needs.
Do not trouble your little head in making complex macros.
Most of these were invented and can be found in
    the \LaTeXe{} companion.
However, it is important to define common symbols and
        terms as macros,  to save typing, but much more importantly, to
        allow changes
        of notation.


A zoologist interested in spiders may therefore write:
    \begin{verbatim}
        \usepackage{xspace}
        \newcommand{\spr}{spider\xspace}
        \newcommand{\sps}{spiders\xspace}
        \newcommand{\Spr}{Spider\xspace}
        \newcommand{\Sprs}{Spiders\xspace}
        ...
        \begin{document}
        ...
        Another \spr came along, and then there were two \sps
            around, which made the situation pretty scary.
        \end{document}
    \end{verbatim}
        \newcommand{\spr}{spider\xspace}
        \newcommand{\sps}{spiders\xspace}
        \newcommand{\Spr}{Spider\xspace}
        \newcommand{\Sprs}{Spiders\xspace}

Which will result in
\begin{quote}
        Another \spr came along, and then there were two \sps
            around, which made the situation pretty scary.
\end{quote}

The \verb+\xspace+ command, defined in the \texttt{xspace} package,
    is designed to combat the annoying habit of commands of swallowing
        all subsequent spaces.
Normally, when a command expands to a word, one should follow
     it by \verb+{}+ as in
        \verb+\LaTeXe{}+.
The \verb+\xspace+ command inserts a space, except when the subsequent
    character is a punctuation mark.

Here is a definition of a common symbol in mathematical writing:
\newcommand{\Dtu}{\Delta u}

\begin{verbatim}   \newcommand{\Dtu}{\Delta u}\end{verbatim}

This can be used later as:
\begin{verbatim}
   \[\Dtu = f\] is a Poisson equation. For $f \equiv 0$
   we get a Laplace equation: \[\Dtu = 0.\].
\end{verbatim}
Which would produce the following output:
\begin{quote}
\[\Dtu = f\] is a Poisson equation. For $f\equiv 0$ we get a Laplace
equation: \[\Dtu = 0.\]
\end{quote}
If you try to use \verb/\newcommand/ to redefine
    an existing command, be it yours, or a \LaTeXe{} builitin,
    you will get an error message.
In the rare cases you wish to override existing commands,
    use \verb/\renewcommand/.

The above definition of \verb \Dtu will only work within math mode.
If you wish to use it outside math mode, you  will need
to use \verb/\ensuremath/, as follows:

\begin{verbatim}   \newcommand{\Dtu}{\ensuremath{\Delta u}}.\end{verbatim}

Experienced writers may define macros as shorthand, as in:

\begin{verbatim}
   \newcommand{\beq}{\begin{equation}}
   \newcommand{\eeq}{\end{equation}}
\end{verbatim}
which would make \verb/\beq ... \eeq/ equivalent to
\begin{verbatim}   \begin{equation} ... \end{equation}.\end{verbatim}

It is a good idea to write all the definitions in a separate
file and include it using the  \verb/\input/ comand.
Another alternative is to collect all commands
in the preamble.
This makes it easy to locate a definition and to quickly change
a notation.


Here is a useful macro with a single argument:
\begin{verbatim}
    \newcommand{\keyword}[1]{\texttt{\textbf{#1}}}
\end{verbatim}
Take note how that the hash character (\#) is used
    for denoting arguments to commands.
With the above definition, one may write:
\begin{verbatim}
``\keyword{static}
    is a heavily overloaded keyword of C++''.
\end{verbatim}

\begin{quote}
``\keyword{static}
    is a heavily overloaded keyword of C++''.
\end{quote}

\subsection{Non-breakable Space}

There are three important cases in which
 \verb+~+%Note how we use \verb for verbatim output.
        (tilde) to denote non-breakable space.

\begin{itemize}
    \item
        \emph{Before inlined mathematical formulae.}
\begin{verbatim}
Let~$i = 1, \ldots, n$, then it is
    not so difficult to prove that~$i \le n$.
\end{verbatim}
        Let~$i = 1, \ldots, n$, then it is not so difficult to
        prove that~$i \le n$.
    \item
        \emph{Before citations.} The \verb+\cite+ command is used
            for citations.
        So, you should always write
\begin{verbatim}
As Gil and Lorenz~\cite{Gil:Lorenz:96} ...
\end{verbatim}
    \item
        Before references, i.e., \verb^\ref^.
To give a label to a figure, table, section, etc, write:
\begin{verbatim}
        \section{\LaTeXe{} Do's and Don'ts}
        \label{do-sec}
\end{verbatim}
The label command gives a name to the value of the last counter
    which \LaTeXe{} used.

Then, to give reference to that section, you can write:
\begin{quote}
        \verb+In Section~\ref{do-sec} we do blah blah.+
\end{quote}
Note that in referencing a section by number, the word ``section''
    must be capitalized.
The same applies to theorems, lemmata, figures, tables, etc.
\end{itemize}

If you want to prevent a line break within a certain word, use the \verb+\mbox+ command.
The following is a definition of a \verb+\CC+ command whose output is a non-breakable ``C++''.
\begin{verbatim}
\newcommand{\CC}{{C++}\xspace}
\end{verbatim}



\section{Organizing Your Article}\label{parts}
\subsection{Sectioning}
Articles are broken invariably partitioned into sections, which are sometimes
    partitioned into subsections.
The \verb+\section+ and the \verb+\subsection+ commands, which take their
    title as an argument, are used in
    making these divisions.
\Ref{Figure}{structure} gives a general
    schematic structure of a \LaTeX{} paper,
    and the use of \verb+\section+ to break
    it into sections.

\begin{figure}
\begin{quote}
\footnotesize
\begin{verbatim}
\documentclass[12pt]{article}
\title{The Ultimate Answer}
\author{Douglas Hitch and Adam Hiking}
\usepackage{times}
\maketitle
\begin{document}
\begin{abstract} The problem of life ... \end{abstract}
\section{Introduction}
Ever through the years, mankind was bothered ...
\paragraph{Outline}
\section{Life} ...
\section{Universe} ...
\section{Everything} ...
\section{Conclusions and Open Problems}
We have shown that the answer is 42.
All that remains is to find the right question.
\paragraph{Acknowledgments}
We thank Agatha Christie for comments made on an
    earlier version of this document.
\bibliography{practice,book,crossref,latex}
\bibliographystyle{abbrv}
\appendix
\section{Proof of Goldbach's Conjecture}
\end{document}
\end{verbatim}
\end{quote}
\caption{The schematic structure of a \LaTeXe{} article}
\label{Figure:structure}
\end{figure}

Also seen in the figure is
    \verb+\paragraph+ command, which is yet another partitioning command, which
    in most document classes is formatted as a single paragraph with no numbering.
The \verb+\appendix+ command does not produce any output.
However, sectioning commands that show up after it are numbered
as appendices (A, B, \ldots in the defaults \texttt{article} document class).


Students have the tendency of over-sectioning, so perhaps I should
    not tell you that there is also a \verb+\subsubsection+ command,
    standing in the hierarchy between \verb+\subsection+ and \verb+\paragraph+.
In fact, I even regret telling you about the \verb+\subsection+
    command.\footnote{Naturally, I won't even mention the
        \texttt{\textbackslash{}subparagraph} command.}
Try to let your text flow smoothly; only break it apart if
    necessary.
As a rule of thumb, a subsection should have four or even
    paragraph, and be introduced only if approved by your advisor.

Longer documents, such as dissertations,
    have chapters (\verb+\chapter+).

Continue by defining the terms. What do you mean by 2-dim?, what is upward planar.


\subsection{The Components of a Paper}
\Ref{Figure}{structure} shows all
    the mandatory textual elements of a
    scientific article.

\begin{description}

\item[Title]
The \emph{Title} should be informative, and not too fancy or cute. Too
special a title might create an unprofessional
impression.

\item[Authors]

In this part, name the authors and their affiliations. Affiliations are
necessary since they give both information to the readers, and credit to
the fonders.
Ordering of authors is significant: usually it is alphabetical. Other
ordering emphasizes the author listed first.



\item[Abstract]
The \emph{abstract} summarizes the paper in the domain's specific
language.
Since the paper is judged first according to the abstract, and can be
rejected based on it alone, it should list the most innovative and
dramatic points of the paper.

The abstract is searched by search-engines, for which purpose
it can include a section of \emph{keywords}, which determine the subject
of the paper. The abstract may include \emph{specifications} -
indices in information-hierarchy trees managed by journals.


\item[Introduction]
The \emph{introduction} is intended for the reader who is familiar with
the
problem's domain. In this section the writers convince the reader that the
problem is worth-while and innovative, and the solution exceeds existing
solutions. Failure in proving these points shall lead to rejection of
the
paper. When no
former solutions exist, the introduction should
prove the problem to be of scientific interest.

\item[Outline]
The \emph{outline} appears as the last paragraph of the Introduction, or
as a separate paragraph. It describes the different sections in the paper,
and shows how they achieve the goals set in the introduction.

The outline is a list of sentences of the form \emph{in
Section 2 we show this}, and \emph{Section 3 includes that}. Use the
word
\emph{we}, even for a single author. To avoid boredom, use both
passive and active forms, along with
various different verbs such as \emph{describe}, \emph{present},
\emph{show}, \emph{outline}, \emph{review},  \emph{discuss},
\emph{prove}, and also  \emph{generalize} and  \emph{conclude}.

Write  \emph{Section} instead of  \emph{section},
as well as  \emph{Figure},  \emph{Table},  \emph{Theorem},  \emph{Lemma}
and,
rarely, \emph{Equation}. Use the word  \emph{Section} even when referring
to a subsection, such as \emph{Section 3.2}.

A special case in which we use \emph{theorem} (lowercase  \emph{t}) when
naming a specific theorem, such as  \emph{Murphy Brown's last theorem}.


\item[Concluding Section]
Various names are used for the final section of a
    paper: \emph{Conclusions}, \emph{Concluding Remarks},
    \emph{Discussion}, \emph{Open Problems}, \emph{Further Research} and
    any combinations
    thereof.

Conclusions often summarize the paper.
Including this part in a paper is done mostly for historical reasons: when
papers used to describe scientific experiments, the Conclusions section
named the conclusions of the experiments' results.

Nowadays, having the papers describe different subjects, the Conclusions
Section should shed a
new
light on what has been stated in the introduction, based on the
thorough understanding of the subject


The \emph{Further Research} Section lists the problems remaining
open---the most difficult and interesting ones.


\item[Acknowledgements]

\item[Bibliography]

\end{description}


Use last names only. A full name gives special honor to authors.


\subsection{Lists}
\LaTeXe{} provides several important mechanisms for an hierarchical organization
    of your text.
There are sevral ways to organize
The first way is itemization:
\begin{itemize}
\item{Itemizing:}
\item{this is an item}
\item{another item}
\end{itemize}
Itemization is created in commands as the following:
\begin{quote}
\begin{verbatim}
\begin{itemize}
\item{Itemizing:}
\item{this is an item}
\item{another item}
\end{itemize}
\end{verbatim}
\end{quote}
The second way is enumeration:


\begin{enumerate}
\item{Enumeration:}
\item{this is an item}
\item{another item}
\end{enumerate}
Where the commands for creating this enumeration are:
\begin{quote}
\begin{verbatim}
\begin{enumerate}
\item{Enumeration:}
\item{this is an item}
\item{another item}
\end{enumerate}
\end{verbatim}
\end{quote}

The third way is using descriptions:

\begin{description}
\item[Description:]
\item[this is an item]
\item[another item]
\end{description}
Where the commands for creating this enumeration are:
\begin{quote}
\begin{verbatim}
\begin{description}
\item{Description:}
\item{this is an item}
\item{another item}
\end{description}
\end{verbatim}
\end{quote}

Too deep an indentation is not recommended, usually use not more than two
levels.



\Section[packages]{Installing New Packages}
Since so many other researchers use \LaTeXe{}
    extensively, it is very likely that
    most of your customization needs have already been
    implemented by others.
All you need to do is search for the solution, which
    almost always shows up as a \emph{package}, sometimes
    called a \emph{style file}.
There are packages for inserting \Lang{PostScript}
    graphics, enriched layout of table, enhanced
    footnotes, typesetting music, commutative diagrams,
    barcodes, Tamil characters, and many many more.
Your \LaTeXe{} installation comes with a rather minimal
    collection of packages.
If what you need cannot be found among these, just
    search the CTAN archives (\texttt{http://www.ctan.org}).
A good search tool is available as
\begin{quote}
\begin{verbatim}
http://ring.asahi-net.or.jp/pub/text/CTAN/help/Catalogue/brief.html
\end{verbatim}
\end{quote}

Sometimes you may even want to define and use your own
    packages, or just install packages downloaded from the net or borrowed
    from a friend.
A case in point is my \texttt{labels} package, which
you can use by writing
\begin{verbatim}
\usepackage{labels}
\end{verbatim}

The tricky bit is that you need to help \LaTeXe{}
    find the package, which is not
    standard.
The file \texttt{labels.sty} is found in
\begin{quote}
    /home/yogi/TeX
\end{quote}
You could use a symbolic link to that directory, but an easier way
    to do that would be to set your \texttt{TEXINPUTS} environment
        variable.
\begin{verbatim}
    setenv TEXINPUTS .:/home/yogi/TeX:
\end{verbatim}

This tells \TeX{} to search for macro files and packages
    first in the current directory, then in my macro directory \texttt{/home/yogi/TeX}
    and then in the standard system location of macro files.
The final colon (\texttt{:}) is crucial.
It tells \LaTeXe{} to continue the search for macro files in the
    standard system path.
Without it, \LaTeXe{} will not be able to process even the most simple
    inputs.
You may also want to create your directory with your own collected packages.
Do no repeat the mistake of so many others in placing the packages in the same directory
as the inputs.

If you are using the WinEdt/MikTeX combination
on personal Windows system, you will need to do the following:
Place the new package in the \texttt{localtexmf} directory, which
is usually
\begin{quote}
\verb+C:\MikTeX\localtexmf\tex\latex+
\end{quote}
or \begin{quote}
\verb+C:\Program Files\MikTeX\localtexmf\tex\latex+
\end{quote}
If the new package likes to reside in its own directory, just place it there.

Then you would need to tell MikTeX that a new package is installed in its path.
To do so, you would need to run the following command from the DOS prompt.
\begin{quote}
\tt
initexmf --update-fndb
\end{quote}
\verb+initexmf+ is usually found in one of the following two directories:
\begin{quote}
\begin{verbatim}C:\MikTeX\texmf\miktex\bin+\end{verbatim}
\begin{verbatim}C:\Program Files\MikTeX\texmf\miktex\bin+\end{verbatim}
\end{quote}
You would need to be in that directory to run this command.



\Subsection[labels]{The \texttt{labels} Package}

Using the \texttt{labels} package,
    there is a much simpler way of defining labels and making
    references.
A section is declared by a command like:
\begin{verbatim}
        \section[do]{\LaTeXe{} Do's and Don'ts}
\end{verbatim}
    where \texttt{do} serves as the section label.
In general, the capitalized version of the command
    takes a label as a second argument.
Thus, there are also \verb+\Subsection+, \verb+\Subsubsection+
    commands.


A section is then referenced by writing
\begin{quote}
        \verb+In \Ref{Section{do} we do tell you what to do.+
\end{quote}
The \verb+\Ref+command supports both backward and \emph{forward}
    references.
The main advantages of the \verb+labels+ package over the standard
    \verb+\label+ and \verb+\ref+ mechanisms are:

\begin{description}
\item[Type safety]
    Writing \verb+\Ref{Figure}{do}+ if \verb+do+
        was a label assigned to a section.

\item[Common abbreviations]
    The \verb+\Ref+ macro is set to use common abbreviations. Thus,
    if you write
\begin{quote}
\verb+\Ref{Section}{do}+
\end{quote}
in your input, the output
    will be:
    \begin{quote}
        Sec.~2 \ldots
    \end{quote}
        Similarly \verb+\Ref{Figure}{xy}+ might come out as
    \begin{quote}
        Fig.~14 \ldots
    \end{quote}

\item[Clear mindedness]
    No need to remember to  put the \verb+~+ before the \verb+\ref+
        command.

\end{description}
The \texttt{labels} package is useful for environments as well:

\begin{verbatim}
    \begin[boats]{Figure}{Boats used to cross the Atlantic}
        ...
    \end{Figure}
\end{verbatim}
Will produce
    \begin{Figure}[boats]{Boats used to cross the Atlantic}
        \ldots
    \end{Figure}

And then you can give reference to the figure using the \verb+\Ref+
    macro

\begin{verbatim}
    In \Ref{Figure}{boats} we see the ...
\end{verbatim}

Will produce the output
\begin{quote}
    In \Ref{Figure}{boats} we see the \ldots
\end{quote}

Similar trick works for tables, which are defined
    using the \verb+Table+ environment which
    takes two arguments, the label, and the caption.

The \verb+\newRef+ command can be used for changing
    the format of references.
The following are predefined in \verb+labels.sty+,
    but can be overridden by the user.
\begin{quote}
\begin{verbatim}
\newRef{Lemma}{Lem.~\ref{Lemma:#1}}
\newRef{Theorem}{Thm.~\ref{Theorem:#1}}
\newRef{Definition}{Def.~\ref{Definition:#1}}
\newRef{Corollary}{Corr.~\ref{Corollary:#1}}
\newRef{Proposition}{Prop.~\ref{Corollary:#1}}
\newRef{Chapter}{Chap.~\ref{Chapter:#1}}
\newRef{Section}{Sec.~\ref{Section:#1}}
\newRef{Appendix }{App.~\ref{Appendix:#1}}
\newRef{Table}{Tab.~\ref{Table:#1}}
\newRef{Figure}{Fig.~\ref{Figure:#1}}
\newRef{Algorithm}{Alg.~\ref{Algorithm:#1}}
\end{verbatim}
\end{quote}




\section{The sentence structure}
\label{roles in a sentence}

\subsection{The Meat and the Bones}

        Every scientific sentence has words of four kinds in it:
        \begin{description}
            \item[Bones (or Objects)]
                These are terms and nouns defining the entities
                of the domain of discourse.
                Most sentences of the paper shall discuss these
                    objects, each contributing, in one way or another,
                    additional information to the reader on these entities.
                The bones should be defined clearly
                    and formally at the beginning of the paper,
                    in order to avoid repetitive qualifications
                    in the sequel.
                The beginning of the paper should define
                    the bones; this would save repetitive,
                    semi-definitions in the sequel.

                In order to avoid repetitive
                Clear and formal definitions of the bones at the
                    beginning of the paper eliminates
                    repetitive and tedious
                    inaccurate references  in the sequel.
                Definitions of bones at the beginning of the paper,
                    if they are done in a clear and accurate manner,
                    would save you tedious and vague references to
                    the bones.
                An up front definition of terms saves tedious,
                    vague and...
                Formal and clear ...
                Repetitive,
                If you find yourself referring to the same term again and
                    again,
                Repetitive references can be avoided by an up front
                    clear definition of the bones.

                Define the bones at the beginning. This will save you
                the tedious work of making repetitive qualifications
                    which are invariably vague.




                Use either the \verb+\emph+ macro, or a proper \verb+\begin{definition}+
                    \ldots \verb+\end{definition}+.
                Sometimes, discovering the bones and is not easy, and is only done
                    in the midst of your writing; you hit a bone
                    when you find yourself using the same phrase
                    again and again.

            \item[Meat (or Attributes)]

                Each sentence should reveal more information about
                    the bones.
                The common way of doing so is by using
                    attributes.
                Attributes supply the valuable information regarding the
                    objects, and should have the main role in sentences.
                In choosing attributes, use a rich and accurate language,
                            as oppose to the simple
                language that should be used when describing the objects.
                Use the most specific word. If a word has a mundane
usage, it is not very specific.

        When using the same term or verb (meat) several times,
            make sure that the meaning remains the same.
        Only in rare cases the meaning can be different, but in these
            cases the differences must be made clear to the reader.
            \item[Connecting tissue]
                These are noise words such as ``the'', ``are'',
                ``hence'', ``such'', etc.
                There are two kinds of connecting words: those
                which are used to bind together the nouns and verbs
                make it grammatically correct and expressive of some
                small coherent idea.
                The other kind of connecting words, are those
                used in connecting each sentence to the previous
                one, and, less frequently, in leading to the next
                sentence.
                These are noise words such as ``usually'', ``moreover'',
        ``hence'', ``such'', ``therefore", ``however", etc.
                They may be added at the beginning, somewhere in the
            middle or the end of the sentence.
            \item[Makeup] This are fancy words, which usually add nothing to the content.
            Avoid these as much as you can.
        \end{description}

\subsection{Tips}

Here is a list of rules and tips which I collected while working
    with many of my students:
\begin{enumerate}
    \item
        Conjugations associate to the left;
        hyphens denote multiple conjugations, as in:
        ``pre- and post-conditions are the essential
            ingredients of \emph{programming by contract}''.
    \item ``Few'' means several. ``A few'' means a small number.

    \item
        New terms must be \emph{emphasized}.
        Frequently, a term is emphasized twice: When first
            mentioned, and again when defined in greater detail.
        The author may choose which one of these occurrences
                to emphasize, when they are close to each other.
        When these two occurrences are near, it is common
                to emphasize only
                one of them.
    \item The first use of a term, defined in
            some other work, must by accompanied with
            proper reference to this work.
    \item Sentences beginning with ``this'', ``that'', ``it''
            are usually ambiguous.
    \item Use symmetry to clarify structure. Asymmetry confuses the
        reader.
    \item  If you use the same term (object) several times,
        then the meaning must be the same.
        In the rare cases that the meaning differs, care must
            be taken to highlight the change in semantics.
    \item Cohesiveness: always related to the previous
        text and lead to the following text.
    \item Each idea must be asserted and proved once and only once.
        It is acceptable to make future references and backward
        references, but these references must not repeat
        the main argument or the definition.
        Never repeat the arguments at the same
        level of detail.
    \item Bones: Sometimes the cure to awkward, verbose
            and cumbersome writing is in simply defining a new term.
    \item If you cannot write a sentence, start over with a different
            point or subject.
    \item Every sentence must end with its strongest part.
        Every paragraph must end with its conclusion.
    \item Good use of fonts makes it easier on the reader.
    \item Does ``thus'' mean follows?
    \item Clearly, obviously, simply, etc.\ are usually not so clear, obvious, and simple.
    \item Don't use quotes and \ldots to cover for sloppy writing and
        imprecise thinking.
    \item Don't use slash (/) as a punctuation mark.
    \item Do not use synonyms adjectives and adverbs in the same
        sentence.
    \item Question every ``very''.
    \item Techniques: go from passive to active.
    \item Techniques: Connect sentences and break them.
    \item Problem indicator: the same word is used at the ending
        of one sentence and in the beginning of the following
        one.
    \item Remove redundant words.
    \item Identify the individual (instance) and the group (class) of
each noun. If it is existential quantifier, use ``a'' or ``an''.
If it is a specific element (a given, or a constant in first
    order logic), use ``the''.
If it is a singleton object, don't use ``a'' or ``the''.
\item Connect sentences properly. Use ``which'' and ``that''.
\item  If you write ``frequently'', ``many'', ``typically'',
``mostly'', you appear to unassertive.
\end{enumerate}



\section{Discussion of a Home Assignment of a Student}
\label{dicussion of home assignment}
In this section we bring various comments on a student's home assignment,
and some \LaTeX{} concepts related to it.

\subsection{Title}\mbox{}\\
The title is \begin{quote}\begin{center}``Scientific Writing - Exercise
1''\end{center}\end{quote}
where it had been nicer written as
\begin{quote} \begin{center}
Scientific Writing \mbox{}\\
Exercise 1 \end{center} \end{quote}
or
\begin{quote} \begin{center}
Scientific Writing \mbox{}\\
Assignment 1 \end{center} \end{quote}


\subsection{General comments}

\begin{itemize}

\item{List the name of the paper referred to in the
bibliography.}
\item{Referring to the authors of a paper as \emph{the
authors} is considered to be disrespecting.}
\item{A word is referred to as a \emph{noise word} when it does not add
information. \emph{Actually} is usually such a word. Noise words should be
avoided.}
\item{A generally hard problem is having the subject well defined in each
sentence. A sentence starting  with words such as \emph{that},
\emph{this} or \emph{it}, is often ambiguous. Usually words like these
ones are agreed to refer to the subject of the former sentence. When
reffering to the same object in a few sentences, consider
giving it a \emph{name}. Using names usually makes sentences clearer.}

\item{Every sentence should be put so that it could have ended with an
exclamation mark. A sentence should end with it's strongest
part.}

\item{Sentences can be connected using different connection words:
\begin{itemize}
\item{words describing a logical sequence, such as
\emph{therefore}, \emph{consequently}, \emph{subsequently} or \emph{thus}}
\item{words describing contrast, such as \emph{nonetheless},
\emph{nevertheless} and \emph{however}}
\item{phrases of example, such as \emph{for example} and \emph{for
instance}}
\end{itemize}
Nevertheless, connection words tend to clog up the paper. A colon
(\verb+:+) is
one way to
avoid connection words.}
\end{itemize}

\subsection{Examples}
\label{home assignment}

In this section we examine a few sentences drawn home assignment, and
offer corrections and rephrasing.

In the paper entitled ``Efficient ... '' In \emph{Efficient
....}.

\noindent\emph{``It is important to specify the institutes of which the
authors come from."}
\begin{enumerate}
\item
\emph{Affiliations} is more suitable here than \emph{institutes}.
\item
\emph{Important} is too general and daily. \emph{Essential} could be used.
\item
A detail missing here is the \emph{reason} why the affiliation should be
specified: one reason is that they provide the funding.
\item
An alternative sentence could be: \emph{Authors specify their
affiliations for funding, and readers are more likely to be appreciative
of papers written in honorable institutes.}
\end{enumerate}


\noindent\emph{``The order in which authors appear is important."}
\begin{enumerate}

\item
The word \emph{important} appears both in this sentence and in the former
one, it should be replaced.

\item
The word \emph{appear} does not add information: use of
\emph{ordering}
could shorten the sentence.

\item
The word \emph{used} appears too often, and is too daily.

\item
Two other words that could match here are \emph{naming} and
\emph{referring}.

\item
This sentence does not belong in this paragraph!

\item
An alternative sentence could be: \emph{When a non-alphabetical order
is used...}

\end{enumerate}


\noindent\emph{``The abstract is written in a unique, specific language."}

\begin{enumerate}

\item
The difference between the words \emph{unique} and \emph{specific} is
unclear, one of them is redundant.

\item
An alternative could be: \emph{The abstract summarizes the paper in the
domain's jargon.}

\end{enumerate}


\noindent\emph{``Usually this part is searched by
search-engines. For this purpose, the abstract can include a part of
keywords of the paper."}
\begin{enumerate}

\item
The word \emph{part} appears twice, having
a different meaning in each place. Both meanings are unclear.

\item
In \emph{for this purpose} it is unclear what the purpose is.



\end{enumerate}


\noindent\emph{``When a paper is given to a conference, it is judged
first according to it's abstract."}
\begin{enumerate}

\item
The word \emph{given} is too simple. \emph{Submitted} is more appropriate.

\item
Instead of \emph{according to}, write \emph{by}.

\item ``it's'' is a shorthand for ``it is''.
The gender neutral possessive form ``its'' should have
been used here.

\end{enumerate}

\noindent\emph{``In English conjugations associates to the left.
        Use hyphens to make your point clear."}
\begin{enumerate}

\item
The sentence can be shortened: \emph{``Conjunctions associate to the
left; hyphens add clarity"}.

Note that now it is unclear. We can add an example.

\item
Another alternative: \emph{Hyphens denote multiple conjunctions, as in:}
(and here comes an example).

\end{enumerate}


\noindent\emph{``Every new term must be \emph{emphasized}.
        Frequently, a term is emphasized twice: When it is first
        mentioned,\ldots{}"}
\begin{enumerate}

\item
Instead of \emph{Every new term} we could shorten: \emph{New terms}.

\item
Instead of \emph{When it is first mentioned}: \emph{When first mentioned}.

Generally, verbs and adjectives can be replaced. Try to form sentences
shorter and emphasize the main part.

\end{enumerate}

\noindent\emph{``The first mentioning of a term which was defined
by
            other authors, must include reference to this other
            work."}
This sentence is not very impressive. It could have been rephrased as:
\begin{enumerate}

\item
\emph{Include reference when first using \ldots{}}.

But this way the
strong point comes in the beginning of the sentence.

\item
\emph{The first use of a term, defined in some other work, must be
accompanied with proper reference to this work.}


\end{enumerate}


\noindent\emph{`Only in rare cases the meaning can be different,
but in these
        cases the differences must be made clear to the reader"}

The sentences could be rewritten as: \emph{In the rare cases that the
meaning can be different, the difference in semantics
must be highlighted. }.


\section{Rephrasing a Sentence--Examples}

\begin{enumerate}

\item
    In~\cite{sally:00} we found the paragraph:
    \begin{quote}
    \begin{small}
        It is important to specify the
        institutes of which the authors come from. The order in which
        authors appear is important: usually alphabetical order is used.
        Using a different order emphasizes the author listed first. When
        naming the authors, usually use last names only. Writing full
        names is a very special honor. Referring to the authors of a paper
        as \emph{the authors} is considered to be dis-respecting.
    \end{small}
    \end{quote}

    By reviewing each sentence separately we get the following points:

    \begin{itemize}
    \item
        ``It is important to specify the institutes of which the authors come
        from." --
        The predicate of this sentence is \textit{authors}
        and the two attributes are \textit{institutes} and \textit{the
        importance to specify it}. Instead of using these attributes
        we could write \textit{affiliation}. It is best to avoid the word
        \emph{from} at the end of the sentence. The word
        \textit{important} is not well used in this context; it's meaning gets
        blurred. A different word that would give a more specific
        meaning is \textit{essential}.

        One way to rephrase this
        sentence is: ``Author's affiliation is essential". This
        proposal lacks the reason for including the affiliation.
        From the author point of view, affiliation of a prestige
        institute credits him. On the other hand, from the institute outlook,
        it's a gratitude for supplying the funding. Putting it all
        together results in: ``Author's affiliation is essential.
        Authors will specify affiliation for funding purposes. Readers
        are more likely to accept authors with important affiliation."

    \item
        ``The order in which authors appear is important: usually
        alphabetical order is used." --
        We have here a repetition of the word
        \textit{important} from the previous sentence. It can be
        replaced with: ``Ordering of authors name is significant."
        Words such as: \textit{usually}, \textit{used} are
        too common and should not be abused.

    \item
        ``Using a different order emphasizes the author listed first."--
        This sentence should be joined together with the previous
        one e.g., ``Referring to the authors in a non-alphabetical
        order emphasizes the importance of the first."

    \end{itemize}

\item
    Another paragraph found in~\cite{sally:00} is:
    \begin{quote}
    \begin{small}
        The abstract is written in a unique, specific language.
        It summarizes the paper.  Usually this part is searched by search-engines.
    \end{small}
    \end{quote}

    By doing the same kind of review as in the previous example we find:

    \begin{itemize}

    \item
        The difference between the words \textit{unique} and
        \textit{specific} isn't clear. In this case it would have
        been better to omit one of them.

    \item
        The word \textit{it} in the second sentence refers to the subject
        of the first one, although this is not clear because the sentence has
        more than one noun. In these cases, starting it with an \textit{it}
        can be confusing.

    \item
        A better way to state the same idea would have been by combining
        the first two sentences: ``The abstract summarizes the paper using
        a unique language."

    \item
        The third sentence introduces a word which wasn't
        discussed before (\textit{part}) and can be inconclusive
        to the reader.

    \end{itemize}

\item
    The sentence, ``When a paper is given to a conference, it is
    judged first according to it's abstract.", could be rewritten
    using more suitable verbs: ``When a paper is submitted to a
    conference, it is judged first by it's abstract."

\item
    ``In English conjugations associates to the left.
    Use hyphens to make your point clear."

    A more suitable way to say the same would be: ``Hyphens add clarity."
    It is recommended to bring an example to illustrate
    your point: ``Hyphens denote multiple conjugations, as in:
    pre- and post-condition are essential ingredients of
    \emph{programing by contract}."

\item
    ``Every new term must be \emph{emphasized}. Frequently, a term is
    emphasized twice: When it is first mentioned,
    and then again when a more complete definition is
    given to it."~\cite{yogi:00}

    It is best to write succinct sentences so that redundant
    words such as \textit{it is} in this example could be
    removed.

\item
    ``If these two occurrences are close, the author may choose
    which one of these to emphasize."~\cite{yogi:00}

    When writing a sentence properly, there exists an innate
    conflict. We prefer to use active voice and not passive,
    forcing the subject to appear at the beginning, but we also
    would like the essence to appear at the end (to emphasize it).
    We can rephrase this example in the following way: ``The authors may
    choose which one of these occurrences to emphasize,
    when they are too close to each other." In this way we emphasize with
    active voice. Alternatively we could write: ``When these two occurrences are
    near, it is common to emphasize one of them." -- putting
    the essence last.

\item
    ``The first mentioning of a term which was defined by
    other authors, must include reference to this other
    work."~\cite{yogi:00}

\end{enumerate}

\label{rephrasing}
\begin{enumerate}
    \item
    In~\cite{sally:00} we find the following paragraph:
    \begin{quote}
    \begin{small}
        It is important to specify the
        institutes of which the authors come from. The order in which
        authors appear is important: usually alphabetical order is used.
        Using a different order emphasizes the author listed first. When
        naming the authors, usually use last names only. Writing full
        names is a very special honor. Referring to the authors of a paper
        as \emph{the authors} is considered to be dis-respecting.
    \end{small}
    \end{quote}

    Lets review each:

    \begin{itemize}
        \item ``It is important to specify the institutes of which the authors come
        from." --
        The predicate of this sentence is \textit{authors}
        and the two attributes are \textit{institutes} and \textit{the
        importance to specify it}. Instead of using these attributes
        we could write \textit{affiliation}. The sentence ends
        with a preposition (\textit{from}), which is best to avoid. The word
        \textit{important} is so widely used that it's meaning is
        blurred. A different word that would give more specific
        meaning is \textit{essential}.

        One way to rephrase this
        sentence is: ``Author's affiliation is essential". This
        proposal lacks the reason for including the affiliation.
        From the author point of view, affiliation of a prestige
        institute gives him credits, and from the institute outlook,
        it's a gratitude for supplying the funding. Putting it all
        together results in: ``Author's affiliation is essential.
        Authors will specify affiliation for funding purposes. Readers
        are more likely to be accepted authors with important
        affiliation."

        \item ``The order in which authors appear is important: usually
        alphabetical order is used." --
        We have here a repetition of the word
        \textit{important} from the previous sentence. It can be
        replace as follows: ``Ordering of authors name is
        significant."
        Words such as: \textit{usually}, \textit{used} are
        too common and should be limited.

        \item ``Using a different order emphasizes the author listed
        first."--
        This sentence should be joined together with the previous
        one e.g., ``Referring to the authors in a non-alphabetical
        order emphasizes the importance of the first."
    \end{itemize}

    \item
    Lets consider the following sentence from~\cite{sally:00}~:
    \begin{quote}
    \begin{small}
        The abstract is written
        in a unique, specific language. It summarizes the paper.  Usually
        this part is searched by search-engines.
    \end{small}
    \end{quote}
        The difference between \textit{unique} and
        \textit{specific} isn't clear.

        \textit{It}, in the second sentence, must refer to the subject
        of the first one. When a sentence have more than one noun,
        starting it with an \textit{it} can be confusing. Therefore
        combining these two sentences together is preferred:
        ``The abstract summarizes the paper using a unique
        language."

        The third sentence introduces a word which wasn't
        discussed before (\textit{part}) and can be inconclusive
        to the reader.

    \item
    Another example from~\cite{sally:00}:
    \begin{quote}
    \begin{small}
        When a paper is given to a conference, it is judged first
        according to it's abstract.
    \end{small}
    \end{quote}
    Using more suitable verbs, the sentence can be rewritten as: ``When a
        paper is submitted to a conference, it is judged first by it's abstract."

    \item
    Let us review the following example from~\cite{yogi:00}:
    \begin{quote}
    \begin{small}
    In English conjugations associates to the left.
    Use hyphens to make your point clear.
    \end{small}
    \end{quote}
        More suitable way to say the same is: ``Hyphens add
        clarity."

        It is recommended to bring an example to illustrate
        your point: ``Hyphens denote multiple conjugations, as in:
        pre- and post-condition are essential ingredients of
        \emph{programing by contract}."

     \item
     Another example form~\cite{yogi:00}:
     \begin{quote}
     \begin{small}
        Every new term must be \emph{emphasized}.
        Frequently, a term is emphasized twice: When it is first
        mentioned, and then again when a more complete definition is
        given to it.
     \end{small}
     \end{quote}
    It is best to write succinct sentences so redundant
        word such as, \textit{it is} in this example should be
        removed.

    \item
    In~\cite{yogi:00} we also find:
    \begin{quote}
    \begin{small}
        If these two occurrences are close, the author may choose
            which one of these to emphasize.
    \end{small}
    \end{quote}
    There is a conflict in writing a proper sentence. We
        want it to be active and not passive -- which force the
        subject to appear at the beginning, but we also want the
        essence to appear at the end. We can rephrase this example
        as follows, while emphasizing on active form: ``The authors may choose which one of these
        occurrences to emphasize, when they are too close to each
        other." or we can write: ``When these two occurrences are
        near, it is common to emphasize one of them."--placing
        the essence last.


    \item
    Finally from~\cite{yogi:00}:
    \begin{quote}
    \begin{small}
        The first mentioning of a term which was defined by
            other authors, must include reference to this other
            work.
    \end{small}
    \end{quote}
    Sometimes changing the sentence from passive to active does
    more harm than good. Rephrases such as, ``Include reference
    when first using a term defined elsewhere."" or ``When using a
    term\ldots", although in active form, are worse.

    In this case we'll prefer leaving the essence of the sentence
    at the end, but use a better choice of words: ``The first use of a
    term, defined in some other work, must be accompanied with
    proper reference to this work."

\end{enumerate}



\section{Discussion of a Home Assignment of a Student}
\label{dicussion of home assignment}
In this section we bring various comments on a student's home assignment,
and some \LaTeX{} concepts related to it.

\subsection{Title}\mbox{}\\
The title is \begin{quote}\begin{center}``Scientific Writing - Exercise
1''\end{center}\end{quote}
where it had been nicer written as
\begin{quote} \begin{center}
Scientific Writing \mbox{}\\
Exercise 1 \end{center} \end{quote}
or
\begin{quote} \begin{center}
Scientific Writing \mbox{}\\
Assignment 1 \end{center} \end{quote}


\subsection{General comments}

\begin{itemize}

\item{List the name of the paper referred to in the
bibliography.}
\item{Referring to the authors of a paper as \emph{the
authors} is considered to be disrespecting.}
\item{A word is referred to as a \emph{noise word} when it does not add
information. \emph{Actually} is usually such a word. Noise words should be
avoided.}
\item{A generally hard problem is having the subject well defined in each
sentence. A sentence starting  with words such as \emph{that},
\emph{this} or \emph{it}, is often ambiguous. Usually words like these
ones are agreed to refer to the subject of the former sentence. When
reffering to the same object in a few sentences, consider
giving it a \emph{name}. Using names usually makes sentences clearer.}

\item{Every sentence should be put so that it could have ended with an
exclamation mark. A sentence should end with it's strongest
part.}

\item{Sentences can be connected using different connection words:
\begin{itemize}
\item{words describing a logical sequence, such as
\emph{therefore}, \emph{consequently}, \emph{subsequently} or \emph{thus}}
\item{words describing contrast, such as \emph{nonetheless},
\emph{nevertheless} and \emph{however}}
\item{phrases of example, such as \emph{for example} and \emph{for
instance}}
\end{itemize}
Nevertheless, connection words tend to clog up the paper. A colon
(\verb+:+) is
one way to
avoid connection words.}
\end{itemize}

\Section{Tables and Figures}

Objects such as figures and tables may be too large to   be
placed at the current position in the text or even on the current
page; they are sometimes floated forward to a place where they
    can be typeset.

There are two environments in \LaTeX\ for figures and for
tables separately, which are responsible for floating the object
to the appropriate place.

\begin{verbatim}
   \begin{object}[pref]
    The body of the object.
   \caption{Title}
   \label{Name}
   \end{object}
\end{verbatim}
where \verb/object/ is either \verb/table/ or \verb/figure/.
The
command \verb/\caption/ may appear in every place between
\verb/\begin{object}/ \ldots \verb/\end{object}/ environment and
according to its location the title will be either above or under
the object.

Together with \verb/\label{Name}/, the command \verb/\ref{Name}/
creates the object number (separately for figures and tables).

By means of an optional argument \verb/pref/ (in the square
braces) user can define object's placement in the text.
\verb/pref/ is a sequence of one or more letters from the
following list (with a preference from left to right):

\begin{itemize}
  \item[\textbf{t}] place the object at the top of the page;
  \item[\textbf{b}] place the object at the bottom of the page;
  \item[\textbf{p}] place the object on the separate page, entirely
  includes ``floated bodies'' only;
  \item[\textbf{h}] place the object neatly in the current text, without floating it.
\end{itemize}

In addition, there are the rules to determine where an object
(table or figure) will appear in the text:

\begin{itemize}
  \item The object is put at the earliest place that does not
  contradict the optional argument.
  \item The floated body cannot be before its environment
  definition and also cannot appear before the previously defined
  floated body from the same kind (figure or table).
  \item Putting the object on the current page cannot overfull it.
  \item If the sign \verb\!\ appears in square braces before the letters sequence of the
  optional argument, then the \LaTeX\ operates accordingly to the sequence, ignoring the
  above rules.
\end{itemize}

The default optional argument is \verb/tbp/ sequence.

\Subsection{Tables}

The basic idea of the article need to be understandable from the
tables of this article. In a book and a thesis there is a list of
numbered tables, which is automatically generated by the command
\verb/\listoftables/ .\vspace{.4cm}

\paragraph{The principles of table producing:}
\begin{enumerate}
  \item The title of the table should be meaningful and independent on
  text.
  \item The title(caption) of the table need to be independent on columns and rows.
  \item It is not allowed to demand from the reader to perform some
  arithmetical operation to understand the table content.
  \item The definition of units and measurement conditions, that appears in the table
  must be exact.
  \item Unnecessary inefficient elements are not to be shown in the table.
  \item The data is displayed in reasonable precision (not
  exaggerated).
  \item The title of the table should be centered.
  \item The numbers are justified to the right.
  \item It is important to reduce the tables and to compress the including
  material up to the possible limit without loss of information.
\end{enumerate}

Earlier we became familiar with the \texttt{table} environment
which makes possible to entitle,
to label, to refer to it and to place the table in the text. Now
we consider the environment which, in fact, creates the table.
Such environment is called \verb/tabular/ and has a structure:

\begin{verbatim}
   \begin{tabular}{format}
   ...
   \end{tabular}
\end{verbatim}

The \verb/format/, in the simplest case, is a sequence of letters,
that describes the structure of the table columns (one letter for
each column). These letters may be as follows:

\begin{itemize}
  \item[\textbf{l}] means a left aligned column;
  \item[\textbf{r}] means a right aligned column;
  \item[\textbf{c}] means a column with centered text.
\end{itemize}

Between the commands \verb/\begin{tabular}{format}/ and
\verb/\end{tabular}/ the text of table is located. Within the
command \verb/\\/ separates the rows of the table, and the sign
\verb/&/ separates the columns of the table inside one row.

There exists a possibility to create a ruled tables in \LaTeX. The
horizontal lines are defined by the command \verb/\hline/ and have
a width which is equal to the general table width. To draw the
vertical lines along the general table height we may put the
symbol \verb/|/ between the letters in the \verb/format/ sequence.

To locate the table at the center (by default it is pinned to the
left of the page) we use the following commands:

\begin{verbatim}
   \begin{center} ... \end{center}
\end{verbatim}
or
\begin{verbatim}
   \centering
\end{verbatim}

To create a more complicated table, such as one with inscription
that includes a number of common columns, in place of the
corresponding table column we need to use a command

\begin{verbatim}   \multicolumn{n}{format}{text}.\end{verbatim}

This command has a three necessary arguments:

\begin{itemize}
  \item \verb/n/ is a number of columns that this ``not standard'' column
  includes.
  \item \verb/format/ (like \verb/\begin{tabular}{format}/) contains
  sequence of letters \verb/l/, \verb/c/, \verb/r/, and/or columns separator -- the
  symbol \verb/|/.
  \item \verb/text/ is a text for this column.
\end{itemize}

For drawing horizontal line, which include a certain number of
columns we need to use the command \verb/\cline{clmn1-clmn2}/
after a \verb/\\/. As in our example bellow, \verb/\cline{2-3}/
makes a horizontal line under second and third columns.

\begin{center}
\begin{tabular}{|l||c|c|}
\hline & \multicolumn{2}{c|}{Grades} \\
            \cline{2-3} Name & Hedva & Algebra
\\ \hline\hline
Cohen Uri & 80 & 85 \\ Levi Gil & 74 & 79 \\ \ldots    & \ldots &
\ldots \\ \hline
\end{tabular}
\end{center}

\begin{verbatim}
\begin{center}
  \begin{tabular}{|l||c|c|}
  \hline & \multicolumn{2}{c|}{Grades} \\
           \cline{2-3} Name & Hedva & Algebra
  \\ \hline\hline
  Cohen Uri & 80 & 85 \\ Levi Gil & 74 & 79 \\
  \ldots    & \ldots & \ldots \\ \hline
  \end{tabular}
\end{center}
\end{verbatim}

As we have mentioned above, if in \verb/table/ environment we
write \verb/\label{tab:word}/, so at every place in the
text we could refer to this  table by means of
\verb/\ref{tab:word}/. For example,


\begin{tabular}{ll}
& From the Table \verb/\ref{tab:word}/ we \\ & can conclude that
the most frequent \\ & English  word is \textbf{the}.

\\
The output we obtain \hspace{.8cm} & \vspace{.2cm}
\\
& From the Table \ref{tab:word} we can conclude that \\ & the most
frequent English word  is \textbf{the}. \vspace{.3cm}
\end{tabular}

\begin{table}[htbp]
  \begin{center}
     \begin{tabular}{|l|c||l|c|}
        \hline
        Word    & Frequency (\%) & Word  & Frequency (\%) \\
        \hline \hline
        the     &    6.421       & that  &     1.244      \\
        of      &    4.028       & is    &     1.034      \\
        and     &    3.150       & i     &     0.945      \\
        to      &    2.367       & it    &     0.930      \\
        a       &    2.029       & for   &     0.770      \\
        in      &    1.778       & as    &     0.764      \\
        \hline
     \end{tabular}
  \caption{The usage frequency of some English words.}
  \label{tab:word}
  \end{center}
\end{table}

The following \LaTeX\ code produces the above table:

\begin{verbatim}
\begin{table}[htbp]
  \begin{center}
     \begin{tabular}{|l|c||l|c|}
        \hline
        Word    & Frequency (\%) & Word  & Frequency (\%) \\
        \hline \hline
        the     &    6.421       & that  &     1.244      \\
        of      &    4.028       & is    &     1.034      \\
        and     &    3.150       & i     &     0.945      \\
        to      &    2.367       & it    &     0.930      \\
        a       &    2.029       & for   &     0.770      \\
        in      &    1.778       & as    &     0.764      \\
        \hline
     \end{tabular}
  \caption{The usage frequency of some English words.}
  \label{tab:word}
  \end{center}
\end{table}
\end{verbatim}

\subsection{Figures}\label{ssec:fig}

The figures (graphs) may be of different types. Some of such types
are considered below. As well as for tables we can make a list of
numbered figures, which is automatically generated by the command
\verb/\listoffigures/.


\textbf{Categories of graphs:}
\begin{enumerate}
  \item Graphs may be conceptual, those which represent their idea without using a visual and
  defined language, for instance Visio.
  \item Graphs, which use visual or well-known language, such as
  diagrams (Rose, VML).
  \item Graphs which represent some data, for example, function plots, statistical data or
  tables. This is another way to create tables, e.g., with help of Excel program
  (Figure \ref{fig:graph}).
  \item Images and photographs.
\end{enumerate}

\begin{figure}[!htb]
   \begin{center}
   \caption{The mid-term exam results of the course "Set Theory" for
   the previous (left column) and the current (right column) semesters.}
   \vspace{.5cm}
   \includegraphics[width = 10cm, height = 14cm]{graph.eps}
   \end{center}
   \label{fig:graph}
\end{figure}

Description of the figure that appears in caption must be such
that anyone can understand it without considering the graph
itself.

If we want to include some picture or graph into \LaTeX\ document
we need use the following command

\begin{verbatim} \includegraphics[key = value, ...]{fname.eps}. \end{verbatim}

Here the graphics file need to be in Encapsulated PostScript
(EPS) format. In addition, in preamble we must include the package

\begin{verbatim}
\usepackage[driver]{graphicx}
\end{verbatim}
where the \verb/driver/ is a program, which is used to convert
from dvi to PostScript. For instance, a \verb/driver/ we use is
\verb/dvips/ program.

Let's return to the command \verb/\includegraphics/ as defined
above. The optional argument in square braces is a list of keys
(such as \verb/width/, \verb/height/, \verb/angle/, \verb/scale/,
\ldots) with their corresponding values. This makes it possible to
scale, to cut out a necessary part of picture, to rotate it by the
certain angle (given in degrees)  or to display it in a certain
size (in \verb/mm/, \verb/cm/, \verb/in/, \verb/pt/, \ldots). The
details can be found in \cite{Grif, Lamp}.

The examples of using this command with the \verb/figure/
environment, discussed in the Section \ref{ssec:tab}, are follow.

\begin{verbatim}
\begin{figure}[htbp]
   \begin{center}
   \includegraphics[width = 7cm, height = 6.5cm]{clown.eps}
   \end{center}
   \caption{The clown.}
   \label{fig:clown}
\end{figure}
\end{verbatim}
\begin{figure}[!htb]
   \begin{center}
   \includegraphics[width = 7cm, height = 6.5cm]{clown.eps}
   \end{center}
   \caption{The clown.}
   \label{fig:clown}
\end{figure}

In the Figure~\ref{fig:clown} the sad clown is shown, and in
the Figure~\ref{fig:plot} plot of some function is displayed.
\begin{verbatim}
\begin{figure}[!htb]
   \centering
   \includegraphics[scale = .4]{plot.eps}
   \caption{Plot of function.}
   \label{fig:plot}
\end{figure}
\end{verbatim}
\begin{figure}[!htb]
   \centering
   \includegraphics[scale = .4]{plot.eps}
   \caption{Plot of function.}
   \label{fig:plot}
\end{figure}
\section{Advanced topics in \LaTeX{}}

\subsection{Numbering}
\label{numbering}

This section discusses numbering. Explanations
are given for figures numbering, and are applicable to tables or sections
numbering, as well.

Figures are numbered, and their numbers appear in their titles,
and in other places in the
text. Hand typing of expressions such as \emph{in Figure 2} or \emph{in
Section 3} is not recommended: changing the
style of entire document (such as changing \emph{in Figure. 2} to
\emph{in Fig. 2} throughout the paper),
or removing one figure, shall require many changes.

\LaTeX{} has an automatic numbering mechanism. Figures, tables and
sections all have separate internal counters, called \texttt{thesection},
\texttt{thefigure} and \texttt{thetabel}. The counters are
incremented after declaring the object (for a section)---or, for
floating
bodies (figures, tables)---after the \verb+begin+ and \verb+caption+
commands.

For example, after the two commands
\begin{quote}\verb+\begin{figure}+
\\ \verb+\caption{some caption}+
\end{quote}
the counter \emph{thefigure} is incremented.

When referring figure's number, give it a label, using
the
command
\begin{quote}\verb+\label{some label name}+
 \end{quote}
The overall series of commands should be:
\begin{quote}\verb+\begin{figure}+
\\ \verb+\caption{some caption}+
\\ \verb+\label{some label name}+
\\ \verb+\end{figure}+
\end{quote}

After the \emph{label} command, the label given refers to the value of the
counter (in this case, \texttt{thefigure}). The command
\begin{quote}\verb+\ref{some label name}+
 \end{quote}
will print the value of the counter, which is the figure number.
\mbox{}\\
In this place it is appropriate to use a tilde
(\verb+~+)
(\emph{a non breakable space})---for example, we could write
\begin{quote}\verb+In Section~\ref{some label name}+
 \end{quote}
in order to get:
\begin{quote}In Section~3
 \end{quote}
\LaTeX{} will not break the expression into two different lines.

\paragraph{Using a Macro} \mbox{}\\
Instead of typing the mentioned text each time, define a
\emph{macro} once
and use it later.
\mbox{}\\
For example, to define a macro named \emph{Ref}, with two parameters, in
\TeX{}:
\begin{quote}\verb+\def\Ref#2{#1~\ref{#1:#2}}+
 \end{quote}
and in \LaTeX{}:
\begin{quote}\verb+\newcommand{\Ref}[2]{#1~\ref{#1:#2}}+
 \end{quote}
where \emph{\#1} refers to the first parameter, and  \emph{\#2} --- to the
second one.
\mbox{}\\
In \LaTeX{}, Defining the same macro twice will produce an
error message, and so defining macros in \LaTeX{} is prefered.

\subsection{\LaTeX{}'s auxiliary files}
\label{LaTeX's auxiliery files}

\TeX{}'s input consists of a \emph{.tex} file, and macro files.
Its output includes a few output files, of which the main one is
a \emph{.dvi\footnote{\emph{Device Independent
Format}}} file. The \emph{.dvi} file can
be viewed and turned into a postscript file.

\TeX{} also outputs auxiliary files, which include the \emph{.log} and
\emph{.aux} files. The \emph{.log} file contains different comments
concerning the compilation, including error messages. The \emph{.aux} file
contains data to be used during the next compilation, such as information
needed to handle commands like \verb+\ref+. During the first run, the
compiler saves all required data, and in the second run it can place
all text correctly. The compiler also checks that the
input \emph{.aux} file (if exists) is identical to the one produced. If
this is not the case (for example, if the file contained circular
definitions) and error message will be produced.

\TeX{} finds the macro files using the environment variable of Unix
\verb+TEXINPUTS+. If the paths are \verb+p1+,  \verb+p2+ and  \verb+p3+,
the variable is set by using the line:
\begin{quote}  \verb+TEXINPUTS p1; p2; p3+\end{quote}
Saving the macro files on the local disk is a mistake, since they can be
changed.

\subsection{Building a Bibliography}
\label{bibliography}

The bibliography is one of the main parts of a paper: the paper is
partially
judged
by it. Readers check if it includes important work done in the
subject.


In order to create a bibliography, use database files, which contain
data concerning the papers to be mentioned in the paper (usually large,
standard files are used, and papers are added to them if necessary).
For each paper in the database a \emph{key} is defined. In order to refer
to a paper, refer to it's key, using the command
\begin{quote}  \verb+\cite{the paper's key}+\end{quote}
This command will print data relevant to the paper.

Creating a bibliography is done by the following commands
\begin{quote}  \verb+\bibliographystyle{abbrv}+
\\ \verb+\bibliography{main}+
\\ \verb+\eject+
\end{quote}
where the first command sets the bibliography style (stype \emph{abbrv} is
usually used), the second one creates the bibliography using the database
file (here it is \emph{main}), and the third one creates the bibliography.

The bibliography includes all the papers we have referred to in
the
paper (using the \verb+\cite+ command).

\paragraph{Behind the Scenes of creating the bibliography}
\mbox{}\\
When \TeX{} runs first, it lists the references to the bibliography
database
in the \emph{.aux} file. BibTeX is a program that searches the \emph{.aux}
file for references to the bibliography database, and using this
information, creates a
\emph{.bbl} file which contains data needed to create a
bibliography list for the paper. In the second run of the compiler, BibTeX
will create the \emph{.bbl} file. In the third run, if the command
\verb+\biblio+\verb+graphy{file name}+ appears, the bibliography is created using
the \emph{.bbl}
file.

\subsection{Creating a Table of Contents}
\label{table of contents}
A \emph{table of contents}
is a list of sections, along
with their page numbers.
A  table of contents is included
in very long papers (over 70 pages), and in thesises, at the begining of
the paper.

To create it, use the command \verb+\tableofcontents+. Similar commands
are \verb+\listoffigures+ and \verb+\listoftables+.
When using these commands, \TeX{} creates \emph{.toc}, \emph{.lot} and
\emph{.lof} files, which are used in the next run, to create the table of
contents or lists of figures and tables.


\section{Mathematical Formulae}

We write mathematical formulae and symbols inside the \texttt{math}
    environment or one of its variants (such as \texttt{equation}).
Because mathematical text is so frequent in scientific writing,
    \TeX{} provides many shortcuts and mechanisms for
        entering and exiting this environment.
Mathematical formulae are either inlined or displayed.
Inlined formulae are written between dollar symbols.
Displayed formulae are enclosed between \verb+\[+ and \verb+\]+,
    or between double dollar symbols, etc.

There are many alternative ways for including formulae in the
    text: inlined formulae can also
    enclosed between \verb+\(+ and \verb+\)+;
displayed numbered formulae are written
    in an \texttt{equation} environment;
also, the \texttt{amsmath} package adds useful
    environments for aligned displayed
    equations.


\subsection{Subscripts and Superscripts}

The underscore character (\_) denotes subscripts, while
    \verb+^+ denotes superscripts.
Here is an example:

\parbox[t]{0.5\textwidth}{\tt\footnotesize
Compare\textasciitilde\$\textbackslash{}sum\_\{i=1\}\symbol{94}(2i-1) = n\symbol{94}2\$
   with \textbackslash[ \\
       \quad \mbox{ }\quad \textbackslash{}sum\_\{i=1\}\symbol{94}(2i-1) = n\symbol{94}2.\\
  \textbackslash]
}
\parbox[t]{0.5\textwidth}{\footnotesize
Compare~$\sum_{i=1}^n (2i-1) = n^2$
    with \[
        \sum_{i=1}^n (2i-1) = n^2.
    \]
}

Sometimes, we would like to write plain text using superscript
or subscript, for example, to add a ``th'' as a superscript to a
number. We can go into the math environment and write, for
example, \verb $20^{th}$  which would indeed appear as $20^{th}$,
but sometimes we would rather not. An acceptable solution is to
use
\begin{verbatim}\textsuperscript{textit{th}}\end{verbatim} which would
yield correct results but is cumbersome to use. The best solution
is to define a macro:
\newcommand{\nth}[2]{#1\textsuperscript{\textit{#2}}}
\begin{verbatim}
\newcommand{\nth}[2]{#1\textsuperscript{\textit{#2}}}
\end{verbatim}
which would appear as \nth{20}{th} when we write
 \verb \nth{20}{th} .

\subsection{Mathematical Symbols}

\LaTeX  commands exist for most common mathematical symbols.
Other
symbols can be found in other packages. Most of these commands
only work within the math environment.

For example, the code
\begin{verbatim}
Let $c\in{C}$ be a class of type $t\in{T}$
\end{verbatim}
would appear as:
\begin{quote}
    Let $c\in{C}$ be a class of type $t\in{T}$
\end{quote}

\subsection{Typefaces for Mathematical Formulae}
It is common that mathematical formulae appear in \textit{italic}.
This is applied automatically to everything in the math
environment.

In regular text, some pairs of letters, such as~$ff$
    and~$fi$ are brought together and take a special form called \emph{ligature}
        which consume less space.
The most famous examples are the \emph{ff} and
    \emph{fi}, other ligatures are \emph{ffi}.
In mathematical environments, ligatures are
    automatically disabled to make it clear that that $fi$ is the product of
        $f$ by $i$.

This false-multiplication problem occurs for other mathematical
symbols.
If everything was typefaced the same, then writing
    $log(n)$ would have look as the multiplication $l*o*g*(n)$.
To prevent this, we need to use the appropriate command, so we
would write \verb$\log(n)$ instead of \verb$log(n)$ resulting in
$\log(n)$ instead of $log(n)$. In the case of a logarithm of base
2, we use the \verb \lg  command instead.



\section{Phrasing Definitions and Theorems}
The following are some rules-of-thumb, to be used when phrasing definitions
and theorems.

\begin{enumerate}
\item
In a text with as \emph{$M_1,M_2,\ldots$}, where it is clear that
$M$ denotes a method, then it is recommended not to write
\emph{Methods $M_1,M_2,\ldots$} unless this is the beginning of a
sentence.

\item
If a variable or a symbol appears only once in the definition, it
is likely that there is a problem with the definition. For
example, we can shorten ``Let $M_1, M_2, \ldots$ be the methods of
a class $C_1$'' to ``Let $M_1, M_2, \ldots$ be the methods of a
class'', which does not confuse the reader with superfluous
symbols.

\item
A formula is a valid part of the syntactic structure of the
sentence, and therefore should be surrounded by punctuations as
usual.

\item
It is common to begin lines in mathematical texts with words such
as \emph{Let} and \emph{Then}.
\end{enumerate}









\subsection{Escaping the Mathematical Special Characters}

Carets are extremely rare in ordinary text.
If the need arises, a caret can inserted using the
    \verb+\verb+ command: \verb/\verb+^+/,
    or by its ASCII code: \verb+\symbol{94}+.
(Note that the \verb+\^+ command places a caret over the
    next character, as in many European languages.)

The dollar symbol is more common in English text, and can be inserted
    as \verb+\$+.
Underscores are abundant in computer related texts.
Again, the \verb+\_+ command works.




\subsection{The Programming Metaphor for Mathematical Notation}

A consistent, coherent and clear use of mathematics
    is often the result of thinking of your paper as if it was
    a program in some statically typed programming
    language.
Single letter notations such as~$i$,~$\epsilon$ and~$G$ are
    scalar variables.
Subscripts and functional notation such as~$x_i$,~$g(y)$ are
    array variables.
Sometime superscripts are used for record structures, as
    in~$\ell^u$ and~$\ell^v$.

This metaphor helps remembering that every new mathematical variable
    must be defined it is to be used.
In some cases the definition is ad-hoc, much like the use of a temporary
    variable, and frequently shortly \emph{after} use.
In the following, the function $g$ and the value~$a$ must
    have been previously
    defined.
\begin{quote}
    We therefore have that~$-a \le g(x) \le a$ for~$0 \le x < 1$.
\end{quote}
In contrast, the variable~$x$ is defined after it has been used.
The scope of this definition is limited to the sentence itself,
    unless intentionally stretched as in:
\begin{quote}
For such~$x$,~$g(x^2) < g(x^3)$ also holds.
\end{quote}

Unless specifically
    restricted, a mathematical definition has global scope.
\begin{itemize}
    \item A \emph{hierarchy} is a pair of a set~$T$ of types, and a partial
        order relation~$\prec$.
    \item Let~$C$ be a graph.
    \item Henceforth, $c$ will denote an arbitrary class.
\end{itemize}
The latter example is a case in which the global scope of the definition
    of~$C$ is made explicit.

It is a good practice to remind the reader of the type of a
    variable whenever it is at the first level of the text.
Adhering to this practice, and extending it when
    appropriate to complex expressions, will help you
    to keep the rule that sentences should
    never start with a formula.
\begin{itemize}
    \item
    Node~$n$ is in the connected component of the graph.
    \item
    Condition~$t' \prec t$ holds since~$t'$ was found
        in a breadth first search starting at~$t$.
\end{itemize}

It is very common in mathematical writing to implicitly
    adopt a \Lang{Fortran}-like
    convention in which designated sections of the mathematical symbols
    vocabulary are reserved for denoting variables of a certain type.
In this convention, the type of most variables is determined by
    their type.
Some of the sections typically used in this convention are:
\begin{enumerate}
    \item $a, b, c, \ldots$ (lower case letters from the beginning of the English alphabet).
    \item $i$, $j$, $k$  and $l$ (often also $\ell$), typically used as integer indices.
    \item $m$, $n$, $p$, $q$, $r$, and $s$, typically used to denote integers. The symbol~$o$
        is rarely every used for anything other than denoting the origin.
    \item $x, y, z, u, v, w$ (lower case letters from the beginning of the English alphabet).
    \item $A, B, C, \ldots$ (lower case letters from the beginning of the English alphabet).
    \item $\alpha, \beta, \gamma$ (and rarely $\delta$ and $\epsilon$).
    \item $\cal A, B, C, \ldots$ (calligraphic letters).
    \item $\mathbf{ A, B, C, \ldots}$ (mathematical bold face letters).
\end{enumerate}
This typing convention is often implicit.
In cases where heavy notation must be used,
    notably in parsing theory, the convention
    is explicitly described.

Avoid using obscure mathematical characters such as $\varrho$, $\varsigma$,
    $\Im$, and $\wp$ whose name would be a mystery to most readers.
An exception is when these are an established convention of the
    domain of discourse.
For example,~$\Im(z)$ is often used to denote the imaginary part
    of a complex number~$z$, and~$\wp(s)$ is often an established
    notation for the power set of a set~$s$.

Good notation is hard to come by---even
    experienced authors tend to change their notation as they write their
    paper.
Does~$n$ denote the input size, or does it stand for a node in a graph?
Does~$p$ denote a prime number, or is it a processor in a distributed
    computing environment?

By using meaningful names instead of the terse mathematical notation,
    changes can later be made.
The preamble is a great place for a dictionary of your notations.
Start by writing
\begin{quote}
\footnotesize
\begin{verbatim}
\newcommand{\newVar}[2]{\newcommand{#1}{\ensuremath{#2}\xspace}}
\end{verbatim}
\end{quote}
Note how \verb+\ensuremath+ was used to make it possible to use
    these macros both in text mode and in math mode.
The \verb+\xspace+ at the end of the definition
    prevents the macro from removing the spaces that follow it.

The next step is to define a small dictionary of notations.
\begin{quote}
\footnotesize
\begin{verbatim}
\newVar{\groups}{G}
\newVar{\length{\ell}
\newVar{\set{S}
\end{verbatim}
\end{quote}




\subsection{Blackboard Bold font}


The blackboard bold font is used for denoting famous algebraic structures: the semi-ring of
natural numbers is denoted \Naturals, the ring of integers is denoted \Integers, while the fields
of rational, real, and complex numbers are denoted \Rationals, \Reals, and
\Complex (respectively).
It is simplistic to assume however that \[
    \Complex = \Reals \times \Reals.
\]

The above text was printed by making the following definitions
(the best place for these is in the preamble):
\begin{quote}
\footnotesize
\begin{verbatim}
\newVar\Naturals{\mathbb{N}}
\newVar\Integers{\mathbb{Z}}
\newVar\Rationals{\mathbb{Q}}
\newVar\Reals{\mathbb{R}}
\newVar\Complex{\mathbb{C}}
\end{verbatim}
\end{quote}
Note that it was necessary to switch to math mode using with dollar symbols in using
    the above macros:
\begin{quote}
\footnotesize
\begin{verbatim}
The blackboard bold font is used for denoting famous algebraic structures:
    the semi-ring of natural numbers is denoted \Naturals, the ring of
    integers is denoted \Integers, while the fields of rational, real,
    and complex numbers are denoted \Rationals, \Reals, and
    \Complex (respectively).
It is simplistic to assume however that \[
    \Complex = \Reals \times \Reals.
\]
\end{verbatim}
\end{quote}

\subsection{New Operators}
\LaTeXe{} has many pre-defined mathematical functions,
    also called operators, including $\sin$, $\lg$, $\min$, etc.,
    which are typeset in ordinary roman font, as in \[
        \log_{10} x = \frac{\ln x}{\ln 10}.
    \]
\begin{quote}
\begin{verbatim}
 \[ \log_{10} x = \frac{\ln x}{\ln 10}. \]
\end{verbatim}
\end{quote}
Do declare your operators, use \verb+\DeclareMathOperator+, as in
\begin{quote}
\begin{verbatim}
\DeclareMathOperator{\parents}{parents}
\end{verbatim}
\end{quote}
Take note that this command can be used only in the preamble, and is usually defined
after
\begin{quote}
\begin{verbatim}
\usepackage{amsopn}
\end{verbatim}
\end{quote}
Now one can write:
\beq{biology}
\forall x \in M \bullet \parents(x) = 2.
\eeq



\subsection{Mathematics Checklist}
\begin{enumerate}
\item Every symbol you use was properly defined and  and that
    it is properly typed.
\item The scope of each definition is clear.
\item Temporary symbols are the only ones with
    overloaded definitions.
\item No sentence begins with a formula.
\item All inlined formulae are preceded by a nonbreakable space.
\item All displayed formulae are properly punctuated.
\item No displayed formula makes false statements
    as required for by contradiction.
\end{enumerate}


\subsection{Fractions, Binomial Coefficients and Cases}



Fractions are generated using the \verb+\frac+ command. Do not use
the obsolete \verb+\over+ command:
\begin{equation}
\frac{\pi^2}{6} = \sum_{n=1}^\infty \frac{1}{n^2}
\end{equation}

The \AmS{} packages make it very easy to generate binomial coefficients
    using the \verb+\binom+ macro. (The obsolete \verb+\choose+ macros was a pain.)
\begin{equation}
2^n = \sum_{n=0}^m \binom{n}{m}
\end{equation}

Cases constructs are common in definitions. Here is an example how
they can be done using the \verb+cases+ environment which is provided
    courtesy of the AMS.
\beq{levels}
\level(x)  \equiv
\begin{cases}
0 & \text{if~$x \in \roots(T)$} \\
\level(p(x)) + 1 & \text{otherwise}
\end{cases}
\eeq


\subsection{Parenthetical Mathematical Expressions}

I like to use the following macros in my preamble to simplify the
    balancing of parenthetical mathematical expressions.
\begin{quote}
\footnotesize
\begin{verbatim}
\newcommand\norm[1]{\ensuremath{\lVert#1\rVert}}
\newcommand\abs[1]{\ensuremath{\lvert#1\rvert}}
\newcommand\ceil[1]{\ensuremath{\lceil#1\rceil}}
\newcommand\floor[1]{\ensuremath{\lfloor#1\rfloor}}
\newcommand\set[1]{\ensuremath{\{#1\}}}
\newcommand\angular[1]{\ensuremath{\langle#1\rangle}}
\newcommand\paren[1]{\ensuremath{(#1)}}
\end{verbatim}
\end{quote}
Here are two simple simple examples showing how these macros might be used:
    \begin{equation}
    \label{norms}
    \begin{split}
        \norm A & = \abs A \ceil{\log_2 \abs\Sigma} \\
        \norm N & = \sum_{i =\abs \Sigma}^{\abs\Sigma + \abs{N} - 1} \ceil{\log_2 k} \\
    \end{split}
    \end{equation}

\begin{quote}
\footnotesize
\begin{verbatim}
    \begin{equation}
    \label{norms}
    \begin{split}
        \norm A & = \abs A \ceil{\log_2 \abs\Sigma} \\
        \norm N & = \sum_{i =\abs \Sigma}^{\abs\Sigma + \abs{N} - 1} \ceil{\log_2 k} \\
    \end{split}
    \end{equation}
    \end{verbatim}
\end{quote}
The \verb+\paren+ macro is provided for the sake of completeness.


The capitalized version of these macros resizes the delimiters to match the size
    of the delimited formula.
The lower case version works best in most cases, and should be
    tried first.
\begin{equation}
 G = \angular{V,E} = \Angular{
                \Set{n^2, \ldots, 2^{n^2}},
                \Set{\angular{i,j} | i = j^2}
           }
 \end{equation}
\begin{quote}
\footnotesize
\begin{verbatim}
 \begin{equation}
 G = \angular{V,E} = \Angular{
                \Set{n^2, \ldots, 2^{n^2}},
                \Set{\angular{i,j} | i = j^2}
           }
 \end{equation}
    \end{verbatim}
\end{quote}
There are at least three different common uses of
    the vertical bar in mathematical forumulae: for denoting an absolute
    value, for denoting the norm (double vertical bar) and for conditions
    in sets.
The above macros distinguish between the first two.
Here is a useful macro that places appropriate space before
    and after the vertical bar commonly used in set definitions.
\begin{quote}
\footnotesize
\begin{verbatim}
\newcommand\st{\;|\;}
    \end{verbatim}
\end{quote}
This macro can then be used as follows
\beqs{hierarchy}
r(T) & \equiv \set{ x \in T \st \nexists y \in T \bullet x \prec_d y}\\
\ell(T) & \equiv \set{ x \in T \st \nexists y \in T \bullet y \prec_d x}\\
\eeq
by typing in the following (which uses the \texttt{equation} package):
\begin{quote}
\footnotesize
\begin{verbatim}
\beqs{hierarchy}
r(T) & \equiv \set{ x \in T \st \nexists y \in T \bullet x \prec_d y}\\
\ell(T) & \equiv \set{ x \in T \st \nexists y \in T \bullet y \prec_d x}\\
\eeq
    \end{verbatim}
\end{quote}








\subsection{Equation Numbering}

\bmeq
    \eq{first} 1^2 & =  1
    \eq{second} 2^2 & =  1+3
    \eq{third} 3^2 & =   1+ 3 + 5
    \eq{fourth} 4^2 & =   1+ 3 + 5 +7
\eeq


\section{Theorems, Definitions, and Related Creatures}
\subsection{Defining Environments and Such}
Theorems and definitions should be easy for the reader to locate
    in a large body of text.
A common technique is to enumerate each of
    these individually,
    and use typography to highlight the theorems.

The \verb \newtheorem  command defines
    environments for theorems, lemmas, corollaries (logical
    conclusions), facts , axioms, definitions, and similarly enumerated
    creatures.
It is common to place all these environment definitions
    at preamble.
These environments can later be used in the
    document body.

The \verb \newtheorem command can be used in one of two ways:
\begin{quote}
    \tt \textbackslash newtheorem\{{\it env\_name}\}\{{\it Theorem}\}[{\it within}]
\end{quote}
\begin{quote}
    \tt \textbackslash newtheorem\{{\it env\_name}\}[{\it numbered\_like}]\{{\it caption}\}
\end{quote}
where {\it env\_name}  defines an environment name which we can
later use to instantiate this environment type.
{\it caption}  is
the caption for the environment which will appear before the
enumeration. {\it within} allows the binding of this environment's
enumeration to a predefined counter instead of the global document
counter.
{\it numbered\_like} makes the environment use the same counter
from another defined theorem environment.
For example, many people like to number theorems and lemmas
    together.

Here is a definition of an environment for axioms,
    numbered within sections.
\newtheorem{axiom}{Axiom}[section]
\begin{verbatim}
   \newtheorem{axiom}{Axiom}[section]
\end{verbatim}
The environment can then be used as follows:
\begin{verbatim}
   \begin{axiom}
   There exists a least element in
        every nonempty set of nonnegative integers.
   \end{axiom}
\end{verbatim}


   \begin{axiom}
   There exists a least element in
        every nonempty set of nonnegative integers.
   \end{axiom}


The following definition
\begin{verbatim}
    \newtheorem{thm}{Theorem}[]
\end{verbatim}
defines a new environment named \texttt{thm},
with global numbering
    which uses the caption ``Theorem''.
To use this definition you may write something like:
\begin{verbatim}
\begin{thm}[Fermat's Last Theorem]
\label{Theorem:Fermat_Last}
    The equation~$x^{n}+y^{n}=z^{n}$ has no non-zero integer solutions
        for~$x$,~$y$ and~$z$ when $n > 2$.
\end{thm}
\end{verbatim}
(Notice how we used the \verb+\label+ command to
    record the theorem number.
Also, notice how \texttt\textasciitilde{} is used to
    prevent line breaks before quoted mathematical definitions.)

The output of the above commands would be then:

\newtheorem{thm}{Theorem}[]
\begin{thm}[Fermat's Last Theorem]
\label{Theorem:Fermat_Last}
    The equation~$x^{n}+y^{n}=z^{n}$ has no non-zero integer solutions
        for~$x$,~$y$ and~$z$ when $n > 2$.
\end{thm}

The optional argument (in square brackets) is used to attribute the mathematical statement
    to its inventor, to provide the year, theorem name, or any
other attribution or comment.

Here is another example:

\begin{thm}[Dirichlet]
 Let $f(x)$ be a function define in~$[-\pi,\,\pi]$ and let \[
    S_m(x) =  \frac{a_0}{2} + \sum_{n=1}^\infty(a_n\cos{nx}+b_n\sin{nx}
 \] be  the partial sums of Fourier' series,
    where the Fourier' coefficients are~$\{a_n\}_{n=0}^\infty$
    and~$\{b_n\}_{n=1}^\infty$.
 Then, the Fourier' series of~$f(x)$ at each point~$x$ converges
    to \[
        \lim_{m\rightarrow\infty}{S_m(x)} = \frac{f(x^+)+f(x^-)}{2}.
    \]
\end{thm}

\begin{verbatim}
\begin{thm}[Dirichlet]
 Let $f(x)$ be a function define in~$[-\pi,\,\pi]$ and let \[
    S_m(x) =  \frac{a_0}{2} + \sum_{n=1}^\infty(a_n\cos{nx}+b_n\sin{nx}
 \] be  the partial sums of Fourier' series,
    where the Fourier' coefficients are~$\{a_n\}_{n=0}^\infty$
    and~$\{b_n\}_{n=1}^\infty$.
 Then, the Fourier' series of~$f(x)$ at each point~$x$ converges
    to \[
        \lim_{m\rightarrow\infty}{S_m(x)} = \frac{f(x^+)+f(x^-)}{2}.
    \]
\end{thm}
\end{verbatim}

\subsection{Referencing Existing Theorems}
  Because it is usually desired in the text to reference a theorem whose
  definition has been given, it is common practice to
  associate a label with that theorem, using the
  \verb \label  command.

  Let us add a theorem to \textit{Fermat's Last Theorem}
  as follows:
\begin{verbatim}
\newtheorem{thm}{Theorem}[]
\begin{thm}[Fermat's Last Theorem]
\label{Theorem:Fermat_Last} The equation $x^{n}+y^{n}=z^{n}$ has
no non-zero integer solutions for x, y and z when $n > 2$.
\end{thm}
\end{verbatim}
We will now reference this. For example, the code:
\begin{verbatim}
The proof of~\ref{Theorem:Fermat_Last} has remained a mystery for
a long time.
\end{verbatim}
Will appear as follows:
\begin{quote}
The proof to Theorem \ref{Theorem:Fermat_Last} has remained a
mystery for a long time.
\end{quote}.

\subsection{Exercise in making definitions}
\begin{definition}[LCOM]
\label{Definition:LCOM}
Let~$v_1, \ldots,v_n$ be the instance variables of class~$C$,
    and let~$M_i$ be the set of methods of~$C$ that use~$v_i$.
Then, $\LCOM(c)$ is the number of unique sets among~$M_1, \ldots, M_n$, i.e.,
    \[
        \LCOM(c) = | \{
M_1, \ldots, M_n
\}|.
\]
We say that~$v_i$ is in the same equivalence
    class as~$v_j$ if~$M_i = M_j$.

Then, the \emph{lack of cohesion in methods} of class~$C$,
    denoted~$\text{LCOM}(c)$, is the number of equivalence classes
    among
    formed by the intersection of~$I_1, \ldots, I_n$.
The sets~$I_1, \ldots, I_n$ partition the instance
    variables of~$C$ into equivalence classes, where
    instance variables~$v_1$ and~$v_2$ are in the same
    equivalence class if
\[
    \forall j \in [1,n] \bullet (v_1 \in I_j
        \Leftrightarrow v_2 \in I_j) .
\]
Then, the \emph{lack of cohesion in methods} of class~$C$,
    denoted~$\text{LCOM}(c)$, is the number of disjoint sets
    formed by the intersection of~$I_1, \ldots, I_n$.
\end{definition}


Let~$\{I_i\}$  be
Let~$I_i$ be the set of instance variables used by~$M_i$.
Method~$M_i$ is not empty, because \ldots

\section{Algorithms}
The best package for writing algorithms is \texttt{algorithmic}.
It is invoked in the preamble by:

\begin{quote}
\begin{verbatim}
\usepackage[noend]{algorithmic}
\usepackage[plain]{algorithm}
\end{verbatim}
\end{quote}

The \verb+noend+ option eliminates the \textbf{end if}, \textbf{end for} etc.
The \verb+algorithm+ package defines the float \verb+algorithm+ environment, which
    behaves much like figures and tables.
The \verb+plain+ option makes the layout of the caption of the algorithm look
    like that of a figure, as in Algorithm~\ref{Algorithm:PQ}, which was produced by the
    following input:

\begin{quote}
\footnotesize
\begin{verbatim}
\begin{algorithm}
\caption{PQ-encoding of a hierarchy $T$}
\label{Algorithm:PQ}
\begin{algorithmic}[1]
\STATE {$\groups[1]\leftarrow {\cal P}_u$}
   \COMMENT{An array of the groups (PQ-trees) created so far.}
\STATE {$\lastGroup \leftarrow 1$}
   \COMMENT{The index of the first unused PQ-tree in \groups.}
\FORALL[Find a PQ-tree consistent with type $x$.] {$x \in T$}
\FOR {$g = 1,\ldots, \lastGroup$ }
        \STATE \textsf{reduce}($\groups[g]$,$\descendants(x)$)
        \STATE \textbf{exit loop if} \textsf{reduce} succeeded
    \ENDFOR
    \STATE {$g_x \leftarrow g$}
    \IF [Start a new universal PQ-tree]
    {g = \lastGroup}
        \STATE
            $\lastGroup \leftarrow \lastGroup + 1$;
            $\groups[\lastGroup] \leftarrow {\cal P}_u$
        \ENDIF
\ENDFOR
\FOR[{Assign a unique id to each type in each group}]
    {$g = 1, \ldots, \lastGroup-1$}
    \STATE{$ \currentId \leftarrow 1$}
        \COMMENT{The first unused id in the group $\groups[g]$.}
    \FORALL {$x \in \frontier(\groups[g])$}
        \STATE $\id_x[g] \leftarrow \currentId$;
                $\currentId \leftarrow \currentId+1$
    \ENDFOR
\ENDFOR
\FORALL[Assign an interval to each type $x$ ]{$x \in T$ }
    \STATE $l_x\leftarrow \min\set{\id_y[ g_x ] \st y \in \descendants(x)}$
    \STATE $r_x \leftarrow \max\set{\id_y[ g_x ] \st y \in \descendants(x)}$
\ENDFOR
\end{algorithmic}
\end{algorithm}
\end{verbatim}
\end{quote}

\begin{algorithm}
\caption{PQ-encoding of a hierarchy $T$}
\label{Algorithm:PQ}
\begin{algorithmic}[1]
\STATE {$\groups[1]\leftarrow {\cal P}_u$}
   \COMMENT{An array of the groups (PQ-trees) created so far.}
\STATE {$\lastGroup \leftarrow 1$}
    \COMMENT{The index of the first unused PQ-tree in \groups.}
\FORALL[Find a PQ-tree consistent with type $x$.] {$x \in T$}
\FOR {$g = 1,\ldots, \lastGroup$ }
        \STATE \textsf{reduce}($\groups[g]$,$\descendants(x)$)
        \STATE \textbf{exit loop if} \textsf{reduce} succeeded
    \ENDFOR
    \STATE {$g_x \leftarrow g$}
    \IF [Start a new universal PQ-tree]
    {g = \lastGroup}
        \STATE
            $\lastGroup \leftarrow \lastGroup + 1$;
            $\groups[\lastGroup] \leftarrow {\cal P}_u$
        \ENDIF
\ENDFOR
\FOR[{Assign a unique id to each type in each group}]
    {$g = 1, \ldots, \lastGroup-1$}
    \STATE{$ \currentId \leftarrow 1$}
        \COMMENT{The first unused id in the group $\groups[g]$.}
    \FORALL {$x \in \frontier(\groups[g])$}
        \STATE $\id_x[g] \leftarrow \currentId$;
                $\currentId \leftarrow \currentId+1$
    \ENDFOR
\ENDFOR
\FORALL[Assign an interval to each type $x$ ]{$x \in T$ }
    \STATE $l_x\leftarrow \min\set{\id_y[ g_x ] \st y \in \descendants(x)}$
    \STATE $r_x \leftarrow \max\set{\id_y[ g_x ] \st y \in \descendants(x)}$
\ENDFOR
\end{algorithmic}
\end{algorithm}


Many customization of the algorithmic package are possible.
The ones used in producing Algorithm~\ref{Algorithm:PQ} were:
\begin{quote}
\footnotesize
\begin{verbatim}
\renewcommand\algorithmiccomment[1]{// \textit{#1}}
\renewcommand\algorithmicif{\textbf{If}}
\renewcommand\algorithmicfor{\textbf{For}}
\renewcommand\algorithmicforall{\textbf{For all}}
\end{verbatim}
\end{quote}

Resist the temptation of applying idiosyncratic programming constructs
    and idioms, such as \texttt{++}, \texttt{:=}, etc.\
    in writing algorithms.
The purpose of writing algorithms is to explain the algorithm,
    not the implementation.
It is not only permissible but also mandated
    to use the power of mathematical formulae,
    and to abstract away from details of the implementation.
Instead of writing
\begin{algorithmic}
\STATE {$s$ \texttt{:=} $0$}
\FOR{$i \leftarrow 1$ to $n$}
    \STATE{$s$ \texttt{+:=} $a[i]$}
\ENDFOR
\end{algorithmic}
write
\begin{algorithmic}
\STATE $s \leftarrow \sum_{i =1}^n a[i]$.
\end{algorithmic}
More generally, mathematical conventions are preferred over
    programming conventions.
Do not choose ``meaningful'', mutliple-character names to
    variables used in algorithms.








\section{Programs}
Actual program code is included in paper is concerned with
    the unique features of a specific programming language.

The \verb+prog2tex+ package, available as \verb+/home/yogi/TeX/prog2tex.sty+,
    is very handy in typing C and \CC programs.
A famous beginner's C program is shown in \Ref{Figure}{famous}.
Note how all the keywords are printed in boldface, text in strings
    is in italics and that comments are typeset in times new roman
    font.



\begin{figure}
\hrulefill
\CPP
#include <stdio.h>
/*
** A small C program to print its argumnts
*/
main(char *argv[], int argc)
{
    int i;

    for (i = 0; i < argc; i++)
        (void) printf("Arg %3d: %s\n", i, argv[i])

    return 0;
}
\END\PROGb{}
\hrulefill
\caption{A C program to print the command line arguments}
\label{Figure:famous}
\end{figure}

With great effort, one can manually generate
    this beautiful output.
The \verb+prog2tex+ package allows you to simply type
    in program code, between \verb+\+\verb+CPP+ and \verb+\END+
    macros, as in \Ref{Figure}{input}.
There is no need to worry about the special meaning of characters
    such as \verb+#+, \verb+<+, \verb+{+, etc.\ to \TeX{}.


\begin{figure}
\hrulefill
\begin{quote}
\begin{verbatim}
\CPP
#include <stdio.h>
/*
** A small C program to print its argumnts
*/
main(char *argv[], int argc)
{
    int i;

    for (i = 0; i < argc; i++)
        (void) printf("Arg %3d: %s\n", i, argv[i])

    return 0;
}
\END
\end{verbatim}
\end{quote}
\hrulefill
\caption{Input for creating the \Ref{Figure}{famous}}
\label{Figure:input}
\end{figure}

Then, you will need to run the program \verb+prog2tex+, available
    as \verb+/home/yogi/bin/prog2ex+, on your input file:
\begin{quote}
\tt
 \% prog2tex \jobname.tex
\end{quote}
This will create an auxiliary file named \texttt{\jobname.prg}, with a macro
    definition generating the above pretty print.
In addition, running \verb+prog2tex+ will also \emph{modify}
    \texttt{\jobname.tex}, adding after the \verb+\END+ command in your input (\Ref{Figure}{input})
    a call to a macro with a funny name such as \verb+\PROGxba+.
The little secret that \texttt{prog2tex.sty} applies is that it simply instructs
    \LaTeXe to completely ignore anything starting at \verb+\+\verb+CPP+,
    and ending at \verb+\END+.
The \verb+\PR+\verb+OGxba+ macro, defined in \texttt{\jobname.prg} does the whole work
    of generating the actual layout.
The \verb+prog2tex+ package just makes sure that the \texttt{\jobname.prg} file
    with all its macros is input before \LaTeXe begins processing the main file.

\Section[style]{The elements of style}

\subsection{Elementary Rules of Usage}

\begin{enumerate}
    \item Form the possessive singular of nouns by adding 's.
    \item In a series of three or more terms with a single
    conjunction, use a comma after each term except the last.
    \item Enclose parenthetic expressions between commas.
    \item Place a comma before and or but introducing an independent clause.
    \item Do not join independent clauses by a comma
    \item Do not break sentences in two
    \item A participial phrase at the beginning of a sentence must refer to the grammatical subject
    \item Divide words at line-ends, in accordance with their formation and pronunciation
\end{enumerate}

\subsection{Elementary Principles of Composition}
\begin{enumerate}
\item Make the paragraph the unit of composition: one paragraph to each topic
\item As a rule, begin each paragraph with a topic sentence; end it in conformity with the beginning
\item Use the active voice
\item Put statements in positive form
\item Omit needless words
\item Avoid a succession of loose sentences
\item Express co-ordinate ideas in similar form
\item Keep related words together
\item In summaries, keep to one tense
\item Place the emphatic words of a sentence at the end
\end{enumerate}







\section{Conclusions}

\paragraph*{Acknowledgments}
I am  grateful to Sally Tadmor, Gil Gattegno and Uriel Cohen for valuable contributions
    to this document.


\eject
\onecolumn


\bibliographystyle{abbrv}
\nocite{Grif}
\nocite{Lamp}
\nocite{Oet}
\bibliography{latex}

\eject
\Appendices
\appendix[first]{First appendix}
\appendix[second]{Second appendix}
\eject













\tableofcontents
\eject
\listoftables
\eject
\listoffigures
\eject
\listofalgorithms

\end{document}

Anything written here will not be compiled or printed.
#ifndef 1

#endif 1
